創(chuàng)建完相應(yīng)的用戶名,密碼控件之后,輸入以下代碼:
成都創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)由有經(jīng)驗(yàn)的網(wǎng)站設(shè)計師、開發(fā)人員和項(xiàng)目經(jīng)理組成的專業(yè)建站團(tuán)隊(duì),負(fù)責(zé)網(wǎng)站視覺設(shè)計、用戶體驗(yàn)優(yōu)化、交互設(shè)計和前端開發(fā)等方面的工作,以確保網(wǎng)站外觀精美、成都網(wǎng)站制作、成都做網(wǎng)站易于使用并且具有良好的響應(yīng)性。
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("登錄失敗,請確認(rèn)用戶名和密碼")
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 "')"