Click here to Skip to main content
16,005,473 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Insert icon/image in menu Pin
LloydA1114-Jan-08 16:21
LloydA1114-Jan-08 16:21 
QuestionHelp me? Pin
n4n4ng2315-Nov-07 12:04
n4n4ng2315-Nov-07 12:04 
AnswerRe: Help me? Pin
Christian Graus15-Nov-07 12:13
protectorChristian Graus15-Nov-07 12:13 
Questionrun a sub on one child form when an event occurs on another Pin
amatbrewer15-Nov-07 11:57
amatbrewer15-Nov-07 11:57 
AnswerRe: run a sub on one child form when an event occurs on another Pin
Christian Graus15-Nov-07 12:15
protectorChristian Graus15-Nov-07 12:15 
GeneralRe: run a sub on one child form when an event occurs on another Pin
amatbrewer15-Nov-07 12:51
amatbrewer15-Nov-07 12:51 
Questionreading query results into vb Pin
cj433115-Nov-07 8:53
cj433115-Nov-07 8:53 
AnswerRe: reading query results into vb Pin
pmarfleet15-Nov-07 9:48
pmarfleet15-Nov-07 9:48 
Hi there.

The syntax for retrieving data using a DataReader would be something like this:

For Each excelrow As DataRow In myExcelDt.Rows
Sql2000Command.CommandText = "select fullname, address, city, state, zip from addresslist where phone = '" & excelrow("phone") & "'"
Using reader As SqlDataReader = Sql2000Command.ExecuteReader()
While reader.Read()
Dim fullname As String = reader.GetString(0)
Dim address As String = reader.GetString(1)
' And so on...
End While
End Using
Next


As an aside, what are you trying to achieve with your code? Do you want to check whether a phone number in the Excel file is valid? If so, it would be better to write a stored procedure that takes a phone number as a parameter, does a lookup on the addresslist table to check whether the phone number exists and returns a boolean value indicating whether it is valid. This method is more efficient than doing the validation in your VB code.

One other thing. Whilst it is nice to be asked personally for help, it is probably better to address questions generally to the forum rather than to specific people. I have to fit my CodeProject excursions round a day job/commute Sigh | :sigh: and I may not be able to answer a question.

Paul Marfleet

"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush


GeneralRe: reading query results into vb Pin
cj433115-Nov-07 10:10
cj433115-Nov-07 10:10 
GeneralRe: reading query results into vb Pin
pmarfleet15-Nov-07 10:25
pmarfleet15-Nov-07 10:25 
GeneralRe: reading query results into vb Pin
cj433115-Nov-07 10:37
cj433115-Nov-07 10:37 
GeneralRe: reading query results into vb Pin
pmarfleet15-Nov-07 10:50
pmarfleet15-Nov-07 10:50 
GeneralRe: reading query results into vb Pin
cj433115-Nov-07 10:56
cj433115-Nov-07 10:56 
GeneralRe: reading query results into vb Pin
pmarfleet15-Nov-07 11:03
pmarfleet15-Nov-07 11:03 
QuestionAccessed by another process Pin
KreativeKai15-Nov-07 8:52
professionalKreativeKai15-Nov-07 8:52 
AnswerRe: Accessed by another process Pin
Christian Graus15-Nov-07 9:24
protectorChristian Graus15-Nov-07 9:24 
AnswerRe: Accessed by another process Pin
Luc Pattyn15-Nov-07 10:56
sitebuilderLuc Pattyn15-Nov-07 10:56 
GeneralRe: Accessed by another process Pin
KreativeKai16-Nov-07 3:25
professionalKreativeKai16-Nov-07 3:25 
QuestionPreload images / Speed up images Pin
SiXke15-Nov-07 8:04
SiXke15-Nov-07 8:04 
AnswerRe: Preload images / Speed up images Pin
Luc Pattyn15-Nov-07 8:20
sitebuilderLuc Pattyn15-Nov-07 8:20 
GeneralRe: Preload images / Speed up images Pin
SiXke15-Nov-07 9:26
SiXke15-Nov-07 9:26 
GeneralRe: Preload images / Speed up images Pin
Luc Pattyn15-Nov-07 9:35
sitebuilderLuc Pattyn15-Nov-07 9:35 
GeneralRe: Preload images / Speed up images Pin
SiXke16-Nov-07 5:49
SiXke16-Nov-07 5:49 
GeneralRe: Preload images / Speed up images Pin
Luc Pattyn16-Nov-07 6:04
sitebuilderLuc Pattyn16-Nov-07 6:04 
GeneralRe: Preload images / Speed up images Pin
SiXke17-Nov-07 6:07
SiXke17-Nov-07 6:07 

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.