Faultly Database Connection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear All,

Can anyone tell me what's going wrong with the following code. I'm fairly
new to C# programming and ready to tear my hair out.

m_Numbes is a DataTable object

DataRow drNewRow = m_Numbers.NewRow();
drNewRow["Key"] = 5;
m_Numbers.Rows.Add(drNewRow);
m_daDataAdapter.Update(m_Numbers);

The code fails on the Update method with an error relating to INSERT INTO.

I'm at my wits end. Any help really appreciated.

Thanks

Greg
 
Need more info. Have you checked DB permissions. Do you have privileges to
insert or update to table. What DB are you using (Access, SQL, Oracle...)
 
Thanks for your reply. It's an Access Database on the local pc. Yes, I have
all the privledges. And an almost identical project works find. I'm very
puzzled.
Any help appreciated.

Thanks

Greg

landagen said:
Need more info. Have you checked DB permissions. Do you have privileges to
insert or update to table. What DB are you using (Access, SQL, Oracle...)

Greg Horwood said:
Dear All,

Can anyone tell me what's going wrong with the following code. I'm fairly
new to C# programming and ready to tear my hair out.

m_Numbes is a DataTable object

DataRow drNewRow = m_Numbers.NewRow();
drNewRow["Key"] = 5;
m_Numbers.Rows.Add(drNewRow);
m_daDataAdapter.Update(m_Numbers);

The code fails on the Update method with an error relating to INSERT INTO.

I'm at my wits end. Any help really appreciated.

Thanks

Greg
 
Back
Top