Click here to Skip to main content
15,898,987 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: C to VB6 Pin
Alex_736-May-07 21:02
Alex_736-May-07 21:02 
AnswerRe: C to VB6 Pin
Christian Graus7-May-07 1:08
protectorChristian Graus7-May-07 1:08 
General[Solved]Re: C to VB6 Pin
Alex_738-May-07 6:11
Alex_738-May-07 6:11 
QuestionLooping Problem - ArgumentOutOfRange - Processes Pin
InfectiousX5-May-07 20:55
InfectiousX5-May-07 20:55 
AnswerRe: Looping Problem - ArgumentOutOfRange - Processes Pin
Dave Kreskowiak6-May-07 5:06
mveDave Kreskowiak6-May-07 5:06 
QuestionMySql Login Pin
LegionFX5-May-07 11:59
LegionFX5-May-07 11:59 
AnswerRe: MySql Login Pin
Paul Conrad5-May-07 12:45
professionalPaul Conrad5-May-07 12:45 
GeneralRe: MySql Login Pin
LegionFX5-May-07 12:51
LegionFX5-May-07 12:51 
Imports MySql.Data.MySqlClient ' this is to import MySQL.NET

Public Class Form1
Dim connString As String = "server=seerver;" _
& "user id=username;" _
& "password=xxxxxxx;" _
& "database=databasename"

Dim conn As New MySqlConnection(connString)
Dim da As MySqlDataAdapter
Dim dst As New DataSet
Dim State As StateEnum
Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
conn.Close()
conn.Dispose()
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load





End Sub

Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
Dim myCommand As New MySqlCommand


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try

conn.Open()
da = New MySqlDataAdapter("SELECT * FROM tblSysLogin WHERE username='" & TextBox1.Text.ToString & "' and password='" & TextBox2.Text & "'", conn)

myCommand.ExecuteScalar()
If myCommand.ExecuteScalar > 0 Then
MsgBox("success")
Else
MsgBox("error")
conn.Close()
End If

Catch myerror As MySqlException
MessageBox.Show("Error Connecting to Database: " & myerror.Message)

End Try
End Sub
End Class


this is the complete code i have in the login form
GeneralRe: MySql Login Pin
Paul Conrad5-May-07 13:22
professionalPaul Conrad5-May-07 13:22 
GeneralRe: MySql Login Pin
LegionFX6-May-07 0:42
LegionFX6-May-07 0:42 
GeneralRe: MySql Login Pin
Paul Conrad6-May-07 4:05
professionalPaul Conrad6-May-07 4:05 
AnswerRe: MySql Login Pin
P P Vilsad6-May-07 4:51
P P Vilsad6-May-07 4:51 
GeneralRe: MySql Login Pin
LegionFX6-May-07 9:17
LegionFX6-May-07 9:17 
GeneralRe: MySql Login Pin
LegionFX6-May-07 9:30
LegionFX6-May-07 9:30 
GeneralRe: MySql Login Pin
Paul Conrad6-May-07 16:50
professionalPaul Conrad6-May-07 16:50 
GeneralRe: MySql Login Pin
P P Vilsad7-May-07 0:44
P P Vilsad7-May-07 0:44 
Questionsearching about for mcpd exams(WINDOWs application) vb2005 Pin
saad badr5-May-07 10:56
saad badr5-May-07 10:56 
AnswerRe: searching about for mcpd exams(WINDOWs application) vb2005 Pin
Dave Kreskowiak6-May-07 4:41
mveDave Kreskowiak6-May-07 4:41 
AnswerRe: searching about for mcpd exams(WINDOWs application) vb2005 Pin
saad badr8-May-07 7:02
saad badr8-May-07 7:02 
GeneralRe: searching about for mcpd exams(WINDOWs application) vb2005 Pin
Dave Kreskowiak8-May-07 17:23
mveDave Kreskowiak8-May-07 17:23 
AnswerRe: searching about for mcpd exams(WINDOWs application) vb2005 Pin
Christian Graus6-May-07 11:38
protectorChristian Graus6-May-07 11:38 
Question[SOLVED] Making the cells in a DGV unselectable Pin
Mightor5-May-07 8:52
Mightor5-May-07 8:52 
Questionhelp with splash screen Pin
hbk_leo5-May-07 8:27
hbk_leo5-May-07 8:27 
AnswerRe: help with splash screen Pin
TwoFaced5-May-07 10:27
TwoFaced5-May-07 10:27 
AnswerRe: help with splash screen Pin
Dave Kreskowiak6-May-07 4:38
mveDave Kreskowiak6-May-07 4:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.