[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
Go Back  Xtreme Visual Basic Talk > > > [help]error connecting SQL 05 to VB 05


Reply
 
Thread Tools Display Modes
  #1  
Old 09-20-2008, 09:13 PM
kenmax kenmax is offline
Newcomer
 
Join Date: Sep 2008
Posts: 5
Default [help]error connecting SQL 05 to VB 05


hi im new here

i just trying out vb and i got this error

does anyone can help?

thx

http://i277.photobucket.com/albums/k...1/errorMSG.jpg


this my function
Quote:
Sub enterForm()
comUserSelect.CommandText = CommandType.Text
comUserSelect.CommandText = "select * from DatabaseSIA.dbo.m_Mahasiswa where NIM = " & txtUserName.Text
mycon.Open()
myreader = comUserSelect.ExecuteReader
If myreader.Read = True Then
code = myreader(0)
Dim a As New fMain
a.Show()
Me.Hide()
Else
MsgBox("Invalid Username or Password")
cleartextbox()
End If
mycon.Close()
End Sub

and my declaration
Quote:
Public str_connection As String = "Server=kenz;Database=DataBaseSIA;Trusted_Connection=False;Integra ted Security=SSPI ;"
Public strMhs As String = "SELECT * FROM m_Mahasiswa"
Public mycon As SqlConnection
Public comUserSelect As New SqlCommand
Public myreader As SqlDataReader
Reply With Quote
  #2  
Old 09-20-2008, 10:46 PM
HorrorGamer HorrorGamer is offline
Regular
 
Join Date: Aug 2008
Location: Surprise, AZ
Posts: 89
Default

You forgot to set the command's connection.

Code:
comUserSelect.Connection = mycon
__________________
Play Tank Games
Reply With Quote
  #3  
Old 09-20-2008, 11:02 PM
kenmax kenmax is offline
Newcomer
 
Join Date: Sep 2008
Posts: 5
Default

Quote:
Originally Posted by HorrorGamer View Post
You forgot to set the command's connection.

Code:
comUserSelect.Connection = mycon
yeah u right..

thx alot
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05 [help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
 
[help]error connecting SQL 05 to VB 05
[help]error connecting SQL 05 to VB 05
 
-->