P
pln
I am trying to update an sql table using stored procedures, C# and ADO.
My code samples are as follows
C#
public void Save(Object s, EventArgs e)
{
sqlConnection sqlConn = new
SqlConnection(ConfigurationSettings.AppSettings["CdDbParam"]);
SqlCommand sqlCmd = new SqlCommand("sp_Update_CallOutDetails",
sqlConn);
SqlCmd.CommandType = CommandType.StoredProcedure ;
sqlCmd.Parameters.Add("@vchCallOutNo", txtbCallOutNo.Text);
sqlCmd.Parameters.Add("@vchCallOutDetails", txtbCallOutDetails.Text);
sqlConn.Open();
sqlCmd.ExecuteNonQuery();
sqlConn.Close();
}
Stored proc
CREATE PROCEDURE [fieldman],[sp_Update_CallOutDetails]
@vchCallOutNo VARCHAR(10), @vchCallOutDetails VARCHAR(1024) AS
UPDATE CallOuts
SET CallOutDetails = @vchCallOutDetails
WHERE CallOutNo = @vchCallOutNo
Using EXECUTE form within SQL works fine.
I get no error messages.
I think the problem is with ADO but where should I look?
(If this is the wrong forum could someone point me in the right
direction).
My code samples are as follows
C#
public void Save(Object s, EventArgs e)
{
sqlConnection sqlConn = new
SqlConnection(ConfigurationSettings.AppSettings["CdDbParam"]);
SqlCommand sqlCmd = new SqlCommand("sp_Update_CallOutDetails",
sqlConn);
SqlCmd.CommandType = CommandType.StoredProcedure ;
sqlCmd.Parameters.Add("@vchCallOutNo", txtbCallOutNo.Text);
sqlCmd.Parameters.Add("@vchCallOutDetails", txtbCallOutDetails.Text);
sqlConn.Open();
sqlCmd.ExecuteNonQuery();
sqlConn.Close();
}
Stored proc
CREATE PROCEDURE [fieldman],[sp_Update_CallOutDetails]
@vchCallOutNo VARCHAR(10), @vchCallOutDetails VARCHAR(1024) AS
UPDATE CallOuts
SET CallOutDetails = @vchCallOutDetails
WHERE CallOutNo = @vchCallOutNo
Using EXECUTE form within SQL works fine.
I get no error messages.
I think the problem is with ADO but where should I look?
(If this is the wrong forum could someone point me in the right
direction).