Greetings I'm using C# with sql server and i have this code with stored procedure which run perfectly with me but with other Run ok but that stored procedure doesn't work on there pc I don't really know why and here my code
private void button6_Click(object sender, EventArgs e)
{
Password frm = new Password();
frm.ShowDialog();
if (password_text == true)
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
DataGridViewCheckBoxCell check = row.Cells[12] as DataGridViewCheckBoxCell;
if (check.Value != null)
{
try
{
if (Convert.ToBoolean(check.Value) == true)
{
SelectedProcced(Convert.ToDateTime(row.Cells[1].Value), row.Cells[2].Value.ToString(), DateTime.Now.ToString("MM/dd/yyy"),_application.Shift.StaffId.ToString());
}
}
catch
{
}
}
}
}
GetDataRP();
}
And here my method which run stored procedure which not working on other pc
public void SelectedProcced(DateTime? createdate, string itemid, string ReviewDate, string STAFFID)
{
connection.Open();
SqlParameter[] param = new SqlParameter[4];
param[0] = new SqlParameter("@createdate", SqlDbType.DateTime);
param[0].Value = createdate;
param[1] = new SqlParameter("@itemid", SqlDbType.NVarChar, 200);
param[1].Value = itemid;
param[2] = new SqlParameter("@ReviewDate", SqlDbType.NVarChar, 200);
param[2].Value = ReviewDate;
param[3] = new SqlParameter("@STAFFID", SqlDbType.NVarChar, 200);
param[3].Value = STAFFID;
ExecuteCommand("SelectedProcced", param);
connection.Close();
}
and here my stored procedure
Create PROCEDURE [dbo].[SelectedProcced]
@createdate datetime, @itemid NVarChar(200),@ReviewDate NVarChar(200),@STAFFID NVarChar(200)
as
UPDATE TOP (1) ax.RETAILTRANSACTIONSALESTRANS2
SET [Process]=1
WHERE ([ITEMID]=@itemid or [BARCODE]=@itemid)
What I have tried:
i'm even try to change name of my stored procedure but the problem is this only method not working in other pc but other methods working perfectly fine with my pc and other pc
the stored procedure is already install with other PC DB