OleDbDataAdapter created in code behaves differently from one created by wizard.
Tech-Archive recommends: Fix windows errors by optimizing your registry
I create 2 data OleDbDataAdapters, one with the wizard, and one in
code. I know the adapter created in code is OK because I use it to
fill a data table.
However, when I try to use the same SQL insert statement in the two
adapters, the adapter created with the wizard works fine, but the
adapter created in code gives me an error "Object reference not set to
an instance of an object". The code is below. What am I doing wrong?
'OleDbDataAdapter1 is created by the wizard. daA is created in code.
sqlA = "Select ID1, ID2 from CrossRef"
Dim daA As OleDbDataAdapter = New OleDbDataAdapter(sqlA, ConnA)
OleDbDataAdapter1.InsertCommand.CommandText = SQL 'this works fine
daA.InsertCommand.CommandText = SQL 'this gives an error
What am I missing?
.
Relevant Pages
- Question on OleDbDataAdapters from a new guy
... I create 2 data OleDbDataAdapters, one with the wizard, and one in ... I know the adapter created in code is OK because I use it to ... when I try to use the same SQL insert statement in the two ... adapteres, the adapter created with the wizard works fine, but the ... (microsoft.public.dotnet.framework) - Re: Is working with a database really this hard? - No, once you figure out the basics!
... The Data Form wizard did just what I wanted. ... and I stumbled on the mini-wizard that configures the adapter, ... I feel like writing the article I haven't been able to find on any of the ... > If you create a Strongly Typed dataset, then go to each control on the ... (microsoft.public.dotnet.languages.csharp) - Re: Network Adapter Configuration
... Running wizard - which one? ... the teamed virtual adapter will be the external as well as the internal nic ... by teaming software) & the internet interface ... (microsoft.public.windows.server.sbs) - Re: ADODB data adapter problem
... I'm using the OLEDB Adapter Wizard to create ... > you that it has generated the SQL statements for SELECT, INSERT, DELETE ... > the adapter, but some of the SQL statements are missing. ... (microsoft.public.dotnet.framework.adonet) - Re: Network Adapter Configuration
... CEICE wizard is run I do not know as: ... > I have 3 physical nics in my server. ... > my External Physical adapter for Internet, and I choose my Virtual Internal ... (microsoft.public.windows.server.sbs) |
|