Click here to Skip to main content
15,886,069 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: BizTalk Pin
Dave Kreskowiak19-Jul-07 3:55
mveDave Kreskowiak19-Jul-07 3:55 
AnswerRe: Share point Pin
Dave Kreskowiak19-Jul-07 3:52
mveDave Kreskowiak19-Jul-07 3:52 
QuestionStopwatch Pin
VB.NET_learner19-Jul-07 2:42
VB.NET_learner19-Jul-07 2:42 
AnswerRe: Stopwatch Pin
Sathesh Sakthivel19-Jul-07 2:45
Sathesh Sakthivel19-Jul-07 2:45 
AnswerRe: Stopwatch Pin
Paul .20-Jul-07 8:01
Paul .20-Jul-07 8:01 
Questionhow to create PDF in vb.net? Pin
phyrrix19-Jul-07 2:04
phyrrix19-Jul-07 2:04 
AnswerRe: how to create PDF in vb.net? Pin
Sathesh Sakthivel19-Jul-07 2:34
Sathesh Sakthivel19-Jul-07 2:34 
QuestionExtracting a single record from a SQL database Pin
aqzman_19-Jul-07 1:43
aqzman_19-Jul-07 1:43 
Hey guys, I'm having a little trouble with what I'm trying to do. I think there is just one or two lines of code that need to be entered (to what I already have), but I'm not exatly sure what it is.

What I'm trying to do extract one record from a SQL database, because right now I have the SQL statement in a combobox with visable disabled, and I know that's not correct.

Here is what I was thinking, and if this is totally wrong just let me know.

Sub Temp(ByVal myConnString As String)
    Dim mySelectQuery As String = "SELECT MAX(TicketID) AS Expr1 FROM tblTicket"
    Dim myConnection As New Data.SqlClient.SqlConnection(myConnString)
    Dim myCommand As New Data.SqlClient.SqlCommand(mySelectQuery, myConnection)
    myConnection.Open()
    Dim myReader As Data.SqlClient.SqlDataReader
    myReader = myCommand.ExecuteReader()
    myReader.Close()
    myConnection.Close()
End Sub


The exact bit of data I want to extract is what would be in "Expr1".

I've tried several different things, as in...

Dim Number as Double
...
Number = myReader...

Hopefully there is just a few lines of code that can be entered to extract that data, if anyone can help me I'd really appreciate it.

Thanks,
aqzman
AnswerRe: Extracting a single record from a SQL database Pin
Colin Angus Mackay19-Jul-07 1:54
Colin Angus Mackay19-Jul-07 1:54 
GeneralRe: Extracting a single record from a SQL database Pin
aqzman_19-Jul-07 2:10
aqzman_19-Jul-07 2:10 
AnswerRe: help Pin
kubben19-Jul-07 1:46
kubben19-Jul-07 1:46 
Jokemore meaningful subject Pin
Luc Pattyn19-Jul-07 2:43
sitebuilderLuc Pattyn19-Jul-07 2:43 
GeneralRe: more meaningful subject Pin
kubben19-Jul-07 2:51
kubben19-Jul-07 2:51 
QuestionError when connecting to Ms access database Pin
Mekong River19-Jul-07 0:34
Mekong River19-Jul-07 0:34 
AnswerRe: Error when connecting to Ms access database Pin
Dave Kreskowiak19-Jul-07 3:44
mveDave Kreskowiak19-Jul-07 3:44 
GeneralRe: Error when connecting to Ms access database Pin
Mekong River19-Jul-07 17:44
Mekong River19-Jul-07 17:44 
GeneralRe: Error when connecting to Ms access database Pin
Dave Kreskowiak20-Jul-07 2:28
mveDave Kreskowiak20-Jul-07 2:28 
GeneralRe: Error when connecting to Ms access database Pin
Mekong River22-Jul-07 15:39
Mekong River22-Jul-07 15:39 
QuestionHow To AOP IN VB.NET Pin
tomaka18-Jul-07 23:43
tomaka18-Jul-07 23:43 
AnswerRe: How To AOP IN VB.NET Pin
Dave Kreskowiak19-Jul-07 3:29
mveDave Kreskowiak19-Jul-07 3:29 
QuestionProblem on Executing application path in VB6.0 Pin
Srinivas Kaparthi18-Jul-07 23:31
Srinivas Kaparthi18-Jul-07 23:31 
AnswerRe: Problem on Executing application path in VB6.0 Pin
Navneet Hegde19-Jul-07 2:38
Navneet Hegde19-Jul-07 2:38 
GeneralRe: Problem on Executing application path in VB6.0 Pin
Srinivas Kaparthi21-Jul-07 1:02
Srinivas Kaparthi21-Jul-07 1:02 
QuestionAccess form1 from form2. Pin
KOKEMO18-Jul-07 23:23
KOKEMO18-Jul-07 23:23 
AnswerRe: Access form1 from form2. Pin
Colin Angus Mackay18-Jul-07 23:39
Colin Angus Mackay18-Jul-07 23:39 

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.