سلام
من یه فرم لاگین دارم که می خوام بره به بانک و بعد از اینکه نام کاربری رمز عبور و تایید کرد بر اساس سطح دسترسی که برای اون کاربر تعریف شده فرم اصلی رو باز کنه البته یه کدی نوشتم که جواب نمی ده از دوستان خواهش می کنم که کمکم کنید.
ممنون
Imports
System.Data
Imports
System.Data.SqlClient
Public
Class Forminput
Dim comboxtype AsString
PrivateSub btn_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_ok.Click
If txtuser.Text = ""Then
ErrorProvider1.SetError(txtuser,
"éلهںٌ ëںê کں© ©ی ¦ي§ ©ں يں©§ ëêںیی§")
ElseIf txtpass.Text = ""Then
ErrorProvider1.SetError(txtpass,
"éلهںٌ ©êھ م ي© ¦ي§ ©ں يں©§ ëêںیی§")
Else
SqlConnection1.ConnectionString =
"Data Source=server\sqlexpress;Initial Catalog=it;Integrated Security=True"
ItDataSet1.pass.Clear()
SqlDataAdapter1.SelectCommand.CommandText =
"SELECT * FORM pass WHERE username='" & txtuser.Text & "' AND password='" & txtpass.Text & "'"
SqlDataAdapter1.SelectCommand.Parameters.Item(0).V alue = txtuser.Text
comboxtype = ItDataSet1.pass(0).type
If comboxtype = "کں©êë§"Then
FormMain.«¦¢ںهھں©ToolStripMenuItem.Enabled =
False
FormMain.ë©êںهھں©ToolStripMenuItem.Enabled =
False
FormMain.¬ کىToolStripMenuItem.Enabled =
False
FormMain.Show()
ElseIf comboxtype = "ê«›é"Then
FormMain.ꬦں¢کں©êë§ںëToolStripMenuI tem.Enabled =
False
FormMain.Show()
ElseIf comboxtype = "ê§ی©"Then
FormMain.Show()
EndIf
EndIf
EndSub
PrivateSub btn_cancle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_cancle.Click
Dim result As MsgBoxResult
result = MsgBox("™یں êی ¦يںىی§ ںھ «ںêںëى ¦ں©¤ ¬يی§؟", MsgBoxStyle.YesNo, "¦©ي¤")
If result = MsgBoxResult.Yes Then
End
EndIf
EndSub
EndClass