重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
创建完相应的用户名,密码控件之后,输入以下代码:
成都创新互联公司网站建设由有经验的网站设计师、开发人员和项目经理组成的专业建站团队,负责网站视觉设计、用户体验优化、交互设计和前端开发等方面的工作,以确保网站外观精美、成都网站制作、成都做网站易于使用并且具有良好的响应性。
Imports System.Data.OleDb
Public Class Form1
Private Sub cmdok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdok.Click
Dim m_username As String
Dim m_userpwd As String
Dim cmd_result As MsgBoxResult
Dim m_da As New OleDbDataAdapter
Dim m_ds As New DataSet
Dim m_command As New OleDbCommand
Dim strsql As String
m_username = txtusername.Text
m_userpwd = txtuserpwd.Text
strsql = " select * from user_info where username='" m_username "' and userpwd='" m_userpwd "'"
OleDbConnection1.Open()
m_command.CommandType = CommandType.Text
m_command.CommandText = strsql
m_command.Connection = OleDbConnection1
m_da.SelectCommand = m_command
m_da.Fill(m_ds, "user_info")
If m_ds.Tables("user_info").Rows.Count 0 Then
cmd_result = MsgBox("欢迎登录", MsgBoxStyle.OKOnly, "提示")
Else
MsgBox("登录失败,请确认用户名和密码")
End If
End Sub
End Class
/// summary
/// 是否存在该记录
/// /summary
public bool Exists(string user_id)
{
StringBuilder Sql = new StringBuilder();
Sql.Append("select count(1) from USER_INFO");
Sql.Append(" where USER_ID=:user_id");
OracleParameter[] parameters = {
new OracleParameter(":user_id", OracleType.VarChar,20)
};
parameters[0].Value = user_id;
object obj = cn.Runsa.Data.OracleHelper.ExecuteScalar(ConfigurationManager.ConnectionStrings["oraclethree"].ToString(), CommandType.Text, Sql.ToString(), parameters);
if (obj == null || obj.ToString() == "0")
{
return false;
}
else
{
return true;
}
改为:
sql = "insert into 表1 values(用户名='" TextBox1.Text "' ,密码='" TextBox2.Text "')"