本文介绍了字符串和二进制数据将在更新网格时被截断。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我在更新屏幕时遇到错误..请在屏幕上显示电话错误。



Dear Frnds,

I have Error during update my Screen.. please tel wats error on my screen.

try
{
    for (int i = 0; i < dgvScreenDetails.Rows.Count-1; i++)
    {
        SqlConnection con = new SqlConnection("Data Source=Param-PC;Initial Catalog=POS;Persist Security Info=True;User ID=sa;Password=123");                          
        con.Open();
        SqlCommand cmd = new SqlCommand("Update  UserCreation set UserId='"+txtUserId.Text+"',UserName='"+txtUserName.Text+"', DepartmentId='"+txtDeptId.Text+"', DepartmentName='"+txtDeptName.Text+"', Password='"+txtPassword+"', ScreenCode='"+dgvScreenDetails.Rows[i].Cells[1].Value+"', ScreenName='"+dgvScreenDetails.Rows[i].Cells[2].Value+"' where UserId='"+txtUserId.Text+"' and ScreenCode='"+dgvScreenDetails.Rows[i].Cells[1].Value+"'", con);

        
       WithValue("@ScreenName", dgvScreenDetails.Rows[i].Cells[2].Value);
        cmd.ExecuteNonQuery();
        con.Close();
    }

    MessageBox.Show("Record Updated");
}



有了问候,

Vivek .R


With Regards,
Vivek .R

推荐答案



这篇关于字符串和二进制数据将在更新网格时被截断。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 17:50