CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2020
    Posts
    6

    [RESOLVED] VB project error to create data in sql server

    Hi all,

    I need some help with my project.

    I create a project to create agents, stores, clients and stores, and i'm trying to save this info in a sql server database local!

    But when i try to create a agent give this error!
    Sry the error may be in Portuguese! :|
    "System.InvalidCastException: 'A conversão da cadeia "Insert into Agentes([Nome],[Cont" para o tipo 'Double' não é válida.'"
    See the attachments please.

    If u need any more information please tell me.
    Thanks!
    GF
    Attached Images Attached Images  
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB project error to create data in sql server

    Looks like you have an extra comma in there after the part with textbox3
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Mar 2020
    Posts
    6

    Re: VB project error to create data in sql server

    Hi DataMiser,

    I have clear the extra comma in the code, but gives me the same error!

    Thanks!

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: VB project error to create data in sql server

    Quote Originally Posted by Goncalof7 View Post
    Hi DataMiser,

    I have clear the extra comma in the code, but gives me the same error!

    Thanks!
    And how now does look like the SQL statement you generate? (Just look at this in your debug/watch window!)
    Victor Nijegorodov

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: VB project error to create data in sql server

    Make the proper data types are getting inserted into the correct columns.

  6. #6
    Join Date
    Mar 2020
    Posts
    6

    Re: VB project error to create data in sql server

    Hi,
    This topic can be close i have fixed the problem!
    I had to search and go step by step to fix, none of yours helps work!

    Thanks.

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: VB project error to create data in sql server

    and what and were was the problem?
    Could you share the solution?
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured