private void button1_Click(object sender, EventArgs e)
{
string connstr = "Data Source=.;Initial Catalog=图书管理系统;Integrated Security=True";
SqlConnection conn = new SqlConnection(connstr);
try
{
conn.Open();
string select = "select * form 管理员登陆表 where 账号='" + 账号.Text + "'and 密码 = '" + 密码.Text + "'";
SqlCommand cmd = new SqlCommand(select, conn);
if (cmd.ExecuteScalar() != null) {
this.Hide();
Form4 a = new Form4();
a.Show();
}
else
{
MessageBox.Show("用户名或密码输入错误");
} }
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
可以运行 运行后 我一点登陆 就出现System.Data.SqlClient.SqlException:'form'附近有语法错误。
{
string connstr = "Data Source=.;Initial Catalog=图书管理系统;Integrated Security=True";
SqlConnection conn = new SqlConnection(connstr);
try
{
conn.Open();
string select = "select * form 管理员登陆表 where 账号='" + 账号.Text + "'and 密码 = '" + 密码.Text + "'";
SqlCommand cmd = new SqlCommand(select, conn);
if (cmd.ExecuteScalar() != null) {
this.Hide();
Form4 a = new Form4();
a.Show();
}
else
{
MessageBox.Show("用户名或密码输入错误");
} }
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
可以运行 运行后 我一点登陆 就出现System.Data.SqlClient.SqlException:'form'附近有语法错误。
解决方案 »
- 很生气,竟然说C#比不上Java
- 序号的设置
- 如何实现用webBrowser打开网页之后点击网页的某个连接
- 错误 1 找不到文件“Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0”
- 结构体定义颜色的问题
- c1truegrid 增加 计算结果列,请高手指教
- DataGrid删除功能?
- 求救:C#中如何将字符串长度为:15000的值存到ORACLE库表的字段中
- 方法名称前面的中括号[]代表什么意思? 这种写法的名称是什么?
- 高分相送:一个一直困扰我的问题,能解决的人立即给分。
- 关于TreeView 无限添加子节点问题? 在线等。。。。。
- serialport的readline怎么用??
and 前面加空格
是 from 不是 form
加上一楼的空格
是from 不是form