Results 1 to 10 of 10

Thread: [RESOLVED] Load Data From Sql Server

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    95

    Resolved [RESOLVED] Load Data From Sql Server

    I have developed an application in VB.NET and a database in MS SQL SERVER2000.I have defined corresponding controls(fields) on the form and I want to retrieve and display records on those controls from SQL Server database. I have defined parameters for SqlDataAdapter,SqlConnect as well as an appropriate data set accordingly.But my concern here is I can not retrieve/Load those records from the database using On-Click event of Fill method ie SqlDataAdapter1.Fill(dataset1).In which case am getting an error message like "An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
    Additional information: System error."


    But still I can preview the records through the SqlDataAdapter!!!!
    OLE DB provider for SQL Server was also set correctly.

    Is there anything should be taken under consideration in SQL SERVER connection setups???since the same VB.NET form worked fine for MS Access database...

    I am really stuck ....please can you help???

  2. #2
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Load Data From Sql Server

    Are you using a DataGridView? I have an idea of what you are doing and I am not sure if this has bearing, but in the Click event of the button maybe att eh top of the sub you should set the Datagridview datasource to nothing then set it to the dataset at the end. This only applies if you are using a DataGridView though.

    Just thinking out loud.
    Currently Using: VS 2005 Professional

  3. #3
    Member
    Join Date
    Aug 2005
    Posts
    49

    Re: Load Data From Sql Server

    Why don't you use sql in namespace system.data.sqlclient? 'cause I think it's easier than using OLEDB. Just check this out. Or send me the code. I'll try to figure out. Have nice day.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    95

    Re: Load Data From Sql Server

    Quote Originally Posted by tacoman667
    Are you using a DataGridView? I have an idea of what you are doing and I am not sure if this has bearing, but in the Click event of the button maybe att eh top of the sub you should set the Datagridview datasource to nothing then set it to the dataset at the end. This only applies if you are using a DataGridView though.

    Just thinking out loud.
    tacoman. If you have read correctly in my post I have mentioned that I am actually using Forms with textboxes controls and not Data Gridview.Though Data Grid didnt workout either.

  5. #5
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Load Data From Sql Server

    If you post some code, it would be better to help you out. This way everyone here will do a guessing work.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    95

    Re: Load Data From Sql Server

    Quote Originally Posted by FatBear
    Why don't you use sql in namespace system.data.sqlclient? 'cause I think it's easier than using OLEDB. Just check this out. Or send me the code. I'll try to figure out. Have nice day.
    Hi Fat Bear Thanks for the response.Well since am a bit new into the VB.NET then could you explain a bit on the above suggestion of yours?? ie use of namespace system.data.sqlclient hows it configured out???I have attached my VB.NET form settings for your consideration.Can you advice me accordingly?

    Thanks&rgds
    ken
    Attached Files Attached Files

  7. #7
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Load Data From Sql Server

    Theres not much of code written in your program. Although it runs perfectly on my system when I change the connection string and the DataBindings. Have you checked if the connection string and databinding properties are set correctly?
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    95

    Re: Load Data From Sql Server

    Quote Originally Posted by Shuja Ali
    If you post some code, it would be better to help you out. This way everyone here will do a guessing work.
    Hello Shuja.
    I have posted some setups and code for your consideration..just checkout my previous post

  9. #9
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Load Data From Sql Server

    Quote Originally Posted by kenone
    Hello Shuja.
    I have posted some setups and code for your consideration..just checkout my previous post
    I posted my previous post only after looking at your code.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    95

    Re: Load Data From Sql Server

    Quote Originally Posted by Shuja Ali
    Theres not much of code written in your program. Although it runs perfectly on my system when I change the connection string and the DataBindings. Have you checked if the connection string and databinding properties are set correctly?
    Connection string and data binding properties are fine.But still I cant display data on the form.However ,I could dipaly data through crystal report.
    I am totally confused

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