473,394 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Faultly Database Connection

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
Nov 16 '05 #1
2 1068
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" wrote:
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

Nov 16 '05 #2
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" wrote:
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" wrote:
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

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50 connections means exactly. Does this mean that only 50...
11
by: pradeep_TP | last post by:
Hi all, I have a few questions that I have been wanting to ask for long. These are all related to ADO.net and specifically to conenction to database. 1) If I have opened a connection to a...
3
by: R Reyes | last post by:
Hi, I'm trying to modularize my database connections a little better and get more out of my project with less code. First check out this common dbOpen() function inside class clsDatabase. I...
2
by: Bryan | last post by:
Hello, I'm just starting to develop in asp.net and i have a question about using a database connection globally in my app. I have set up the procedures for getting all my connection string info...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
35
by: Terry Jolly | last post by:
Web Solution Goal: Have a global database connection Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once. I put the connection...
6
by: Arsalan Ahmad | last post by:
Hi all, I am creating a website in which in an Item detail page there are a number of web controls (7 or 8) and what is happening that inside each of control's Page_Load() function I am creating...
5
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.