早教吧作业答案频道 -->其他-->
英语翻译usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;namespaceWindowsFormsApplication2
题目详情
英语翻译
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication24
{
public partial class Form2 :Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender,EventArgs e)
{
}
private void button1_Click(object sender,EventArgs e)
{
this.Close();
}
private void button2_Click(object sender,EventArgs e)
{
SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;
AttachDBFilename=|DataDirectory|Database1.mdf;Integrated Security=True;User Instance=True");
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "insert into Table1(Name,Password) values(@name,@pwd)";
cmd.CommandText = "select*from Table1 where Name=@aa";
cmd.Parameters.AddWithValue("aa",textBox1.Text);
SqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
return;
}
if (textBox1.Text == "")
{
MessageBox.Show( "请输入用户名");
return;
}
if (textBox2.Text == "")
{
MessageBox.Show("请输入密码");
return;
}
cmd.Dispose();
conn.Dispose();
SqlConnection conn1 = new SqlConnection(@"Data Source=.\SQLEXPRESS;
AttachDBFilename=|DataDirectory|Database1.mdf;Integrated Security=True;User Instance=True");
conn1.Open();
SqlCommand cmd1 = conn1.CreateCommand();
cmd1.CommandText = "insert into Table1(Name,Password) values(@name,@pwd)";
cmd1.Parameters.AddWithValue("name",textBox1.Text);
cmd1.Parameters.AddWithValue("pwd",textBox2.Text);
cmd1.ExecuteNonQuery();
MessageBox.Show("注册成功!");
textBox1.Text = "";
textBox2.Text = "";
cmd.Dispose();
conn1.Dispose();
}
private void textBox2_TextChanged(object sender,EventArgs e)
{
}
private void textBox1_TextChanged(object sender,EventArgs e)
{
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication24
{
public partial class Form2 :Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender,EventArgs e)
{
}
private void button1_Click(object sender,EventArgs e)
{
this.Close();
}
private void button2_Click(object sender,EventArgs e)
{
SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;
AttachDBFilename=|DataDirectory|Database1.mdf;Integrated Security=True;User Instance=True");
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "insert into Table1(Name,Password) values(@name,@pwd)";
cmd.CommandText = "select*from Table1 where Name=@aa";
cmd.Parameters.AddWithValue("aa",textBox1.Text);
SqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
return;
}
if (textBox1.Text == "")
{
MessageBox.Show( "请输入用户名");
return;
}
if (textBox2.Text == "")
{
MessageBox.Show("请输入密码");
return;
}
cmd.Dispose();
conn.Dispose();
SqlConnection conn1 = new SqlConnection(@"Data Source=.\SQLEXPRESS;
AttachDBFilename=|DataDirectory|Database1.mdf;Integrated Security=True;User Instance=True");
conn1.Open();
SqlCommand cmd1 = conn1.CreateCommand();
cmd1.CommandText = "insert into Table1(Name,Password) values(@name,@pwd)";
cmd1.Parameters.AddWithValue("name",textBox1.Text);
cmd1.Parameters.AddWithValue("pwd",textBox2.Text);
cmd1.ExecuteNonQuery();
MessageBox.Show("注册成功!");
textBox1.Text = "";
textBox2.Text = "";
cmd.Dispose();
conn1.Dispose();
}
private void textBox2_TextChanged(object sender,EventArgs e)
{
}
private void textBox1_TextChanged(object sender,EventArgs e)
{
}
}
}
▼优质解答
答案和解析
就是个连接数据库的登陆/注册的窗体,这些你随便在网上一搜就一堆
看了 英语翻译usingSyste...的网友还看了以下:
已知:2Zn(s)+O2(g)===2ZnO(s)ΔH1=-701.0kJ·mol-12Hg(l) 2020-04-07 …
在下列化学平衡体系中,若增大压强,平衡向正反应方向移动的是A:2HL(g)H2(g)+L2(g)B 2020-05-14 …
●试题二 对文法G[S]:S→a|∧|(T);T→T,S|S;回答问题1~问题3。 【问题1】 对文 2020-05-26 …
关于微积分设f(x),g(x)在[a,b]上连续,在(a,b)内可微,证明存在t∈(a,b),使f 2020-06-10 …
实验测得,从150cm高处自由下落的物体的下落时间t(s)与相应的高度h(m)、速度v(m/s)间 2020-07-19 …
C的一段程序如果输入两位或两位以上的数(假设位数为n)把这个数的后n-1位输出例如输入123输出2 2020-07-26 …
若等比数列{an}的前n项和与积分别为S和T,数列{1/an}的前n项和为S',求证T^2=(S/ 2020-07-28 …
若把(s+t)、(s-t)分别看作一个整体,指出下面式子中的同类项.1.3分之1(s+t)-5分之 2020-08-01 …
编译原理文法设文法G(S):S→(L)|a+S|aL→L,S|S求(1)给出G[S]等价的文法G‘[ 2020-11-23 …
从地面竖直向上抛射一个小球,在落地之前,物体向上的速度v(m/s)是运动时间t(s)的一次函数.经测 2021-01-12 …