Dataset problem

G

Guest

From my windows form, I configured a Data Adapter and generated a dataset to
load data from a SQL database table. Then I used a code to fill the dataset.
The code returns the error message: "An unhandled exception of type
'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error."

The code I used is the following. What am i doing wrong?

Dim IntakeBindingManager As BindingManagerBase
SqlDataAdapter1.Fill(DS_SSCIntake1)
IntakeBindingManager = Me.BindingContext(DS_SSCIntake1, "qmf_cint")

Thanks
 
C

Cor Ligthert

TS

Can you try this,

dim IntakeBindingManager As CurrencyManager
SqlDataAdapter1.Fill(DS_SSCIntake1)
IntakeBindingManager = Me.BindingContext(DS_SSCIntake1, "qmf_cint")

IntakeBindingManager = DirectCast(BindingContext(DS_SSCIntake1, "qmf_cint"),
CurrencyManager)

You cannot use (normally) base classes directly.

I hope this helps,

Cor
 
G

Guest

Thanks for your reply. I'm still getting the same error message. I used the
syntax you sent me:
Dim IntakeBindingManager As CurrencyManager
SqlDataAdapter1.Fill(DS_SSCIntake1)
IntakeBindingManager = DirectCast(BindingContext(DS_SSCIntake1, "qmf_cint"),
CurrencyManager).

Please advise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top