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...
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.
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.
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.
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?
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.
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