获取错误:无效的对象名称'User_Information [英] Getting a error : Invalid object name 'User_Information

查看:89
本文介绍了获取错误:无效的对象名称'User_Information的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SqlCommand cmd = new SqlCommand("sp_userinformation", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@UserName", UserName);
                cmd.Parameters.AddWithValue("@Password", Password);
                cmd.Parameters.AddWithValue("@FirstName", FirstName);
                cmd.Parameters.AddWithValue("@LastName",LastName );
                cmd.Parameters.AddWithValue("@Email",Email );
                cmd.Parameters.AddWithValue("@PhoneNO", Phoneno);
                cmd.Parameters.AddWithValue("@Location", Location);
                cmd.Parameters.AddWithValue("@Created_By", Created_By);
                cmd.Parameters.Add("@ERROR", SqlDbType.Char, 500);
                cmd.Parameters["@ERROR"].Direction = ParameterDirection.Output;
                cmd.ExecuteNonQuery();
                message = (string)cmd.Parameters["@ERROR"].Value;
                con.Close();
            }
            else
            {
                Page.RegisterStartupScript("UserMsg", "<Script language='javascript'>alert('" + "Password mismatch" + "'); </script>");
            }
            lblErrorMsg.Text = message;







if (txtpwd.Text == txtcnmpwd.Text)
 {
 string UserName = txtuser.Text;
 string Password = txtpwd.Text;
 string ConfirmPassword = txtcnmpwd.Text;
 string FirstName = txtfname.Text;
 string LastName = txtlname.Text;
 string Email = txtEmail.Text;
 string Phoneno = txtphone.Text;
 string Location = txtlocation.Text;
 string Created_By = txtuser.Text;







i我在上面声明列名




i am declaring column name as above

推荐答案

尝试在后端执行你的SP。似乎在给定的数据库中没有名称User_information的对象。

这很可能是您尝试查询但不存在的表或视图。
Try executing your SP in the backend. It seems there is no object with the name User_information in the given database.
This is most likely a table or view that you are trying to query but does not exist.


if(txtpwd.Text == txtcnmpwd.Text)

{

string UserName = txtuser.Text;

string Password = txtpwd .Text;

string ConfirmPassword = txtcnmpwd.Text;

string FirstName = txtfname.Text;

string LastName = txtlname.Text;

string Email = txtEmail.Text;

string Phoneno = txtphone.Text;

string Location = txtlocation.Text;

string Created_By = txtuser.Text;









i am声明列名如上
if (txtpwd.Text == txtcnmpwd.Text)
{
string UserName = txtuser.Text;
string Password = txtpwd.Text;
string ConfirmPassword = txtcnmpwd.Text;
string FirstName = txtfname.Text;
string LastName = txtlname.Text;
string Email = txtEmail.Text;
string Phoneno = txtphone.Text;
string Location = txtlocation.Text;
string Created_By = txtuser.Text;




i am declaring column name as above


这篇关于获取错误:无效的对象名称'User_Information的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆