1。怎样从一个textBox1输入UserID,通过数据库在textBox2中显示出UserName
2。
解决方案 »
- 请推荐证券交易系统的书或相关网站论坛等资源, C++,C#均可, 谢谢
- c#添加引用时,找不到命名空间System.Windows.Documents
- 请教关于streamreader不能识别中文的原因
- 在线等,javascript语言(C#)中日期大小的比较
- c#里如何快速提取html里的文字?
- 请高手帮忙:如何将Excel表导入Access数据库,前提是数据库中没有该表,需要根据导入的表自动在数据库中建立表?
- wpf 在canv as中怎么实现橡皮擦功能
- 急!!在线等!!!请问:在MVC中,如何在Controllers里调用View里的js函数
- 关于使用XPATH解析xml的问题
- 关于运行.exe文件问题
- 小弟现在要用Excel做报表。希望各位大哥高手们提供点资料,谢谢了。
- winform checkedlistbox的问题?
SqlConnection conn = new SqlConnection(sConn);
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
textBox2.Text = cmd.ExecuteScalar().ToString();
cmd.Dispose();
conn.Close();
然后textBox2.text=usernmae;
{
if (txtRWellGuid.Text.Trim() != "" || txtRWellGuid.Text.Trim() != string.Empty)
{
string sql = "select UserName from table1 where UserID="+textBox1.Text;
string sConn=""//你的连接字符串
SqlConnection conn = new SqlConnection(sConn);
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
textBox2.Text = cmd.ExecuteScalar().ToString();
cmd.Dispose();
conn.Close(); }
}
string sql = "select UserName from table1 where UserID="+textBox1.Text; // 这个是SQL语句
SqlConnection conn = new SqlConnection(sConn); // sConn 是数据库联接字符串 自己去写
conn.Open(); // 打开操作
SqlCommand cmd = new SqlCommand(sql, conn); // 执行SQL语句
textBox2.Text = cmd.ExecuteScalar().ToString();
cmd.Dispose();
conn.Close();
string sql = "select UserName from table1 where UserID="+textBox1.Text; // 这个是SQL语句
SqlConnection conn = new SqlConnection(sConn); // sConn 是数据库联接字符串 自己去写
conn.Open(); // 打开操作
SqlCommand cmd = new SqlCommand(sql, conn); // 执行SQL语句
textBox2.Text = cmd.ExecuteScalar().ToString();
cmd.Dispose();
conn.Close();
string StrConn= ConfigurationSettings.AppSettings["ConnectionStr"];
//
string Sql = "select UserName from table1 where UserID="+textBox1.Text;
SqlConnection Conn = new SqlConnection(StrConn);
Conn.Open();
SqlCommand Cmd = new SqlCommand(Sql, conn);
textBox2.Text = Cmd.ExecuteScalar().ToString();
Cmd.Dispose();
Conn.Close();
你也是三星用户了,别教坏小孩子
以后别教人写这样代码
string sql = "select UserName from table1 where UserID="+textBox1.Text;
protected void txt_textBox1_TextChanged(object sender, EventArgs e)
{
//dosomething
}
string sql = "select UserName from table1 where UserID="+textBox1.Text;
这样的代码也写
我是通过jsp和javascript来做的
把TEXTBOX1的内容做WHERE条件
把TEXTBOX2需要的内容做SELECT后面的字段名1LZ看看SQL方面的知识吧,不管以后搞什么,SQL语句都用得上
2有兴趣看点ADO。NET方面的书
3不管FORM,还是WEB,找书了解下控件,再学习一种语言最后,LZ加油,刚开始都是这样的。建议你有问题多问你身边的人,他们会乐于帮你的,
只要你虚心点,有点眼色(不要别人真忙着时候不停的问)