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

Visual Basic

 
QuestionHow to update a TableAdapter Pin
Chatura Dilan9-Mar-06 14:54
Chatura Dilan9-Mar-06 14:54 
AnswerRe: How to update a TableAdapter Pin
mayhem_rules9-Mar-06 17:09
mayhem_rules9-Mar-06 17:09 
GeneralRe: How to update a TableAdapter Pin
Chatura Dilan9-Mar-06 18:17
Chatura Dilan9-Mar-06 18:17 
GeneralRe: How to update a TableAdapter Pin
Chatura Dilan9-Mar-06 23:04
Chatura Dilan9-Mar-06 23:04 
QuestionDataGridView-IMP Pin
projectcode19-Mar-06 9:40
projectcode19-Mar-06 9:40 
QuestionWhat does the @ do in the following statement? Pin
kenn_rosie9-Mar-06 3:52
kenn_rosie9-Mar-06 3:52 
AnswerRe: What does the @ do in the following statement? Pin
Craster9-Mar-06 4:27
Craster9-Mar-06 4:27 
GeneralRe: What does the @ do in the following statement? Pin
Colin Angus Mackay9-Mar-06 23:44
Colin Angus Mackay9-Mar-06 23:44 
Craster wrote:
The items with '@' in front refer to parameters being supplied to a stored procedure.


Among other things. See also Guffa's reply to the Original Poster.


Craster wrote:
The only reason you should ever see this in VB code is if the code is attempting to create the stored procedure on the SQL Server - I can't see that this would ever work if you attempt to run it as an update statement directly from a VB app.


This is incorrect.

Craster wrote:
It's possible that someone's copied and pasted the code from a stored procedure directly into VB as an attempt to do an update, but I don't believe it can possibly work.


Yes, it can work. You pass parameters for any SQL Statement through the SqlCommand object. For example. The SQL:
SELECT * FROM MyTable WHERE name=@name
Can be accessed in VB as:
Dim cmd As SqlCommand
cmd = New SqlCommand()
cmd.CommandText="SELECT * FROM MyTable WHERE name=@name"
cmd.Parameters.Add("@name", "John Smith")
cmd.Connection = MyConnection
Dim reader As SqlDataReader
reader = cmd.ExecuteReader()


ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

AnswerRe: What does the @ do in the following statement? Pin
Guffa9-Mar-06 4:31
Guffa9-Mar-06 4:31 
QuestionToolbar display Pin
contact ajo9-Mar-06 3:40
contact ajo9-Mar-06 3:40 
AnswerRe: Toolbar display Pin
Joshua Quick9-Mar-06 11:17
Joshua Quick9-Mar-06 11:17 
Questiondatabase triggers Pin
Qaiser_Iftikhar9-Mar-06 3:28
Qaiser_Iftikhar9-Mar-06 3:28 
AnswerRe: database triggers Pin
Steve Pullan9-Mar-06 11:08
Steve Pullan9-Mar-06 11:08 
AnswerRe: database triggers Pin
Krisky9-Mar-06 18:53
Krisky9-Mar-06 18:53 
QuestionRe: database triggers Pin
Qaiser_Iftikhar9-Mar-06 22:42
Qaiser_Iftikhar9-Mar-06 22:42 
AnswerRe: database triggers Pin
Steve Pullan10-Mar-06 0:40
Steve Pullan10-Mar-06 0:40 
GeneralRe: database triggers Pin
Qaiser_Iftikhar10-Mar-06 1:21
Qaiser_Iftikhar10-Mar-06 1:21 
QuestionRe: database triggers Pin
Steve Pullan12-Mar-06 12:13
Steve Pullan12-Mar-06 12:13 
AnswerRe: database triggers Pin
Qaiser_Iftikhar10-Mar-06 1:25
Qaiser_Iftikhar10-Mar-06 1:25 
GeneralRe: database triggers Pin
Dave Kreskowiak10-Mar-06 3:22
mveDave Kreskowiak10-Mar-06 3:22 
AnswerRe: database triggers Pin
Qaiser_Iftikhar10-Mar-06 3:33
Qaiser_Iftikhar10-Mar-06 3:33 
GeneralRe: database triggers Pin
Dave Kreskowiak10-Mar-06 7:11
mveDave Kreskowiak10-Mar-06 7:11 
AnswerRe: database triggers Pin
Qaiser_Iftikhar10-Mar-06 8:37
Qaiser_Iftikhar10-Mar-06 8:37 
GeneralRe: database triggers Pin
Dave Kreskowiak10-Mar-06 17:58
mveDave Kreskowiak10-Mar-06 17:58 
GeneralRe: database triggers Pin
Qaiser_Iftikhar11-Mar-06 1:00
Qaiser_Iftikhar11-Mar-06 1:00 

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.