且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法在数据库中找到列

更新时间:2023-10-22 23:04:22

您在图像列数据类型中出错了。您应该使用图像数据类型或二进制数据类型声明图像列。你应该将上传的文件转换为特定的数据类型意味着图像或二进制。
You did a mistake in image column data type. you should declare image column with image data type or binary data type. And you should convert the uploaded file to specific data type means image or binary.


你错过了插入查询中的列'状态'。



cmd = new SqlCommand(插入登录名(姓名,姓名,姓名,用户名,密码,联系人,dob,电子邮件,地址,职业,ltype,状态,图像)值('+ txtfirst.Text + ','+ txtmid.Text +','+ txtsur.Text +','+ txtname.Text +','+ txtpass.Text +','+ txtcontact.Text + ','+ txtdob.Text +','+ txtemail.Text +','+ txtaddr.Text +','+ txtocc.Text +','+ typeButtonList1.SelectedValue + ','+ image1.ImageUrl +'),conn);
You missed a column 'status' in insert query.

cmd = new SqlCommand("insert into login(name,midname,surname,username,password,contact,dob,email,address,occupation,ltype,status,image) values('" + txtfirst.Text + "','" + txtmid.Text + "','" + txtsur.Text + "','" + txtname.Text + "','" + txtpass.Text + "','" + txtcontact.Text + "','" + txtdob.Text + "','" + txtemail.Text + "','" + txtaddr.Text + "','" + txtocc.Text + "','" + typeButtonList1.SelectedValue + "','"+image1.ImageUrl+"')", conn);