本文介绍了SQL Server插入错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮帮我.我收到错误,但是没有代码.当我运行该页面时,它显示了这样的错误
对对象"employeeinfm",数据库"samp",模式"dbo"的插入权限被拒绝."
是什么原因导致此错误.
请为此提出建议..

Hi Please help me. I m getting the error but not in code. While i run that page it shows an error like this
"INSERT permission denied on object ''employeeinfm'', database ''samp'', schema ''dbo''."
What is the cause of this error.
Please suggest a solution for this..

try
{
    cmd = new SqlCommand("insert into employeeinfm values (@employeeid,@employeename,@designation,@password,@confirmpwd)", cn);

    cmd.Parameters.Add("@employeeid", SqlDbType.NVarChar, 50)
                   .Value = Txtempid.Text;
    cmd.Parameters.Add("@employeename", SqlDbType.NVarChar, 50)
                   .Value = Txtename.Text;
    cmd.Parameters.Add("@designation", SqlDbType.NVarChar, 50)
                   .Value = Txtdesig.Text;
    cmd.Parameters.Add("@password", SqlDbType.NVarChar, 50)
                   .Value = Txtpwd.Text;
    cmd.Parameters.Add("@confirmpwd", SqlDbType.NVarChar, 50)
                   .Value = Txtconfirmpwd.Text;

    cn.Open();
    cmd.ExecuteNonQuery();
    Label7.Text = "Saved successfully!";
    cn.Close();
}
catch (Exception ex)
{
    Response.Write(ex.Message);
}



在此先感谢
Ramya.P
email:[email protected]



Thanks in advance
Ramya.P
email:[email protected]

推荐答案



dbo.employeeinfm [before]
samp.employeeinfm [after]



所以,请检查一下.如果是dbo,则需要该用户的写权限.



so, please check that. If it is dbo then you need the write permission for that user.


这篇关于SQL Server插入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 21:11