locked
Campo Gravar tipo em dados de acesso Tabela vb RRS feed

  • Question

  • B

    Good morning , I hum aplicataivo using Visual Studio , and I used a Table Access As Database, the work datagridview , but WHEN I try to record a new record of the Next Error:


    Segue Abaixo como está o meu código

     Private Sub Btn_gravar_Click (sender As Object, e As EventArgs) Alcas Btn_gravar.Click         Me.TabPrincipalTableAdapter.Insert (Txt_classificacao.Text, Txt_Data.Text, Txt_deposito.Text, Txt_descricao.Text,                                            Txt_pagamento.Text, Txt_situacao.Text, Txt_tipo.Text, Txt_vencto.Text)         'here da este Erro: Informações Adicionais: A Conversão da Cadeia de caracteres'. Date 'NÃO tipo' 'NAO E valida         Me.TabPrincipalTableAdapter.Update (DataSet1.TabPrincipal)         MessageBox.Show ( "Registro Gravado")         Me .TabPrincipalTableAdapter.Fill (Me.DataSet1.TabPrincipal)     End Sub









    • Edited by Lca-Luiz Tuesday, May 10, 2016 12:00 AM
    Sunday, May 8, 2016 3:32 PM

Answers

  • Hello and welcome to the forums,

    When posting a question please post using English as this forum is an English speaking forum. Also, use the code button to post code.

    Okay, what I can make out is there is a incorrect value being used in the insert statement of the TableAdapter indicated by InvalidCastException. Example, passing a value which should be a date but is not a date. Check the value or values being sent to the query.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, May 8, 2016 8:01 PM

All replies

  • This is an English language forum. Perhaps you posted your question in a Portuguese language forum and somehow it magically moved to this forum. Regardless please edit your original post and translate it to English even if you have to use an online language translator to do so.

    Este é um fórum de idioma Inglês. Talvez você postou sua pergunta em um fórum idioma Português e de alguma forma magicamente mudou-se para este fórum. Independentemente favor editar o seu post original e traduzi-lo para Inglês, mesmo se você tem que usar um tradutor online para fazê-lo.


    La vida loca

    Sunday, May 8, 2016 3:43 PM
  • Also,  copy your code directly from the VS IDE and paste it in the Forum using the "Insert Code Block" button.

    If you say it can`t be done then i`ll try it

    Sunday, May 8, 2016 3:51 PM
  • Hello and welcome to the forums,

    When posting a question please post using English as this forum is an English speaking forum. Also, use the code button to post code.

    Okay, what I can make out is there is a incorrect value being used in the insert statement of the TableAdapter indicated by InvalidCastException. Example, passing a value which should be a date but is not a date. Check the value or values being sent to the query.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, May 8, 2016 8:01 PM