| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 523 人关注过本帖
标题:新手请教不理解的代码!
只看楼主 加入收藏
helifu
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2006-12-9
收藏
 问题点数:0 回复次数:1 
新手请教不理解的代码!

Public User As String
Public password As String
Dim conn As New SqlConnection("Server=.;" & _
"Database=ViBook; " & _
"Integrated Security=SSPI ")
Dim comm As New SqlCommand
Dim ds As New DataSet
Dim da As New SqlDataAdapter
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
User = TextBox1.Text
password = TextBox2.Text
Dim str As String
str = "select * from 管理员信息 where 姓名='" & User & "' and 密码='" & password & "'"
comm.Connection = conn '这几处我不懂,希望朋友们帮忙解释下,谢谢
comm.CommandType = CommandType.Text '这几处我不懂,希望朋友们帮忙解释下,谢谢
comm.CommandText = str '这几处我不懂,希望朋友们帮忙解释下,谢谢
da.SelectCommand = comm '这几处我不懂,希望朋友们帮忙解释下,谢谢
还有下面这个
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress '这个触发事件是什么意思
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) _
And TextBox2.Text <> "" Then '这个地方也不明白
Me.Button1_Click(Nothing, Nothing) '这个地方也不明白
End If
End Sub

搜索更多相关主题的帖子: password 
2006-12-09 21:10
bygg
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:乖乖的心中
等 级:版主
威 望:241
帖 子:13555
专家分:3076
注 册:2006-10-23
收藏
得分:0 
comm.Connection = conn ' 数据库连接
comm.CommandType = CommandType.Text '数据库执行的类型
comm.CommandText = str '执行的语句是 str
da.SelectCommand = comm 'da 的选择命令

If e.KeyChar = Microsoft.VisualBasic.ChrW(13) _
And TextBox2.Text <> "" Then '如果按下的按钮值是 13 并且TextBox2中没有数据
Me.Button1_Click(Nothing, Nothing) '执行Button1的Click事件
End If

[此贴子已经被作者于2006-12-10 0:28:05编辑过]


飘过~~
2006-12-10 00:24
快速回复:新手请教不理解的代码!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026246 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved