dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: VB project error to create data in sql server

  1. #1
    Join Date
    Mar 2020
    Posts
    2

    Question 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
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,337

    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
    2

    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
    19,624

    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,248

    Re: VB project error to create data in sql server

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

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)