Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Count Field Incorrect Error While Updating

Author  Topic 

Swati Jain
Posting Yak Master

139 Posts

Posted - 2006-12-18 : 09:06:03
private void UpdateOfficer(String ConnectionString, string Name, string Address,int ID)
{
String QueryString = "UPDATE Simple SET(Name=?,Address=?) WHERE( Name=?,Address=?,ID=?)";

using (OdbcConnection Connection = new OdbcConnection(ConnectionString))
{

//Connection.DataSource. = "LexEyeDsn";
//Connection.Driver = "ODBCDriver";
//Connection.Database = "Lexeye.mdb";
//Connection.
Connection.ConnectionString = ConnectionString;
OdbcCommand Cmd = new OdbcCommand(QueryString, Connection);

//.NET Framework Data Provider for OLE DB
//Cmd.Parameters.Add(ID,
Cmd.CommandType = CommandType.Text;
Cmd.CommandText = QueryString;
Cmd.Connection = Connection;

Cmd.Parameters.AddWithValue(Convert.ToString(@ID), ID);
Cmd.Parameters.AddWithValue(@Name, Name);
Cmd.Parameters.AddWithValue(@Address, Address);
//SqlDataReader dr;
Connection.Open();
Cmd.ExecuteNonQuery();
Connection.Close();



}
}

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-18 : 09:32:01
I think you better post this in ASP.NET forum

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-18 : 09:34:27
Run the profiler to check for the final query text and post it here so that we can help you.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -