Click here to Skip to main content
15,892,005 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: I hate Combo Box Pin
Dave Kreskowiak1-Oct-07 5:48
mveDave Kreskowiak1-Oct-07 5:48 
QuestionINSERT INTO Query with apostrophes in filenames? Pin
eyeball_20031-Oct-07 3:52
eyeball_20031-Oct-07 3:52 
AnswerRe: INSERT INTO Query with apostrophes in filenames? Pin
Dave Kreskowiak1-Oct-07 4:13
mveDave Kreskowiak1-Oct-07 4:13 
AnswerRe: INSERT INTO Query with apostrophes in filenames? Pin
eyeball_20031-Oct-07 5:27
eyeball_20031-Oct-07 5:27 
GeneralRe: INSERT INTO Query with apostrophes in filenames? Pin
Dave Kreskowiak1-Oct-07 5:48
mveDave Kreskowiak1-Oct-07 5:48 
AnswerRe: INSERT INTO Query with apostrophes in filenames? Pin
Guffa1-Oct-07 6:32
Guffa1-Oct-07 6:32 
GeneralRe: INSERT INTO Query with apostrophes in filenames? Pin
eyeball_20031-Oct-07 7:16
eyeball_20031-Oct-07 7:16 
AnswerRe: INSERT INTO Query with apostrophes in filenames? Pin
mmelick1-Oct-07 10:34
mmelick1-Oct-07 10:34 
To use parmaters in your insert statement use the following approach:

Public Sub SqlCommandPrepare()
    Dim id As Integer = 20
    Dim desc As String = "myFirstRegion"
    Dim rConn As SqlConnection = New SqlConnection("Persist Security Info=False;" & _
                 "Integrated Security=SSPI;database=northwind;server=mySQLServer")
    rConn.Open()
    Dim command As SqlCommand = New SqlCommand("", rConn)

    ' Create and prepare an SQL statement.
    command.CommandText = "insert into Region (RegionID, RegionDescription) values (@id, @desc)"
    command.Parameters.Add("@id", id)
    command.Parameters.Add("@desc", desc)
    command.Prepare() ' Calling Prepare after having set the Commandtext and parameters.
    command.ExecuteNonQuery()

    ' Change parameter values and call ExecuteNonQuery.
    command.Parameters(0).Value = 21
    command.Parameters(1).Value = "mySecondRegion"
    command.ExecuteNonQuery()
End Sub


This example was copied from the MSDN website at
http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.prepare(VS.71).aspx

Matt Melick
Questiondatagridview ? Pin
moomoooomoo1-Oct-07 3:47
moomoooomoo1-Oct-07 3:47 
AnswerRe: datagridview ? Pin
Dave Kreskowiak1-Oct-07 4:10
mveDave Kreskowiak1-Oct-07 4:10 
GeneralRe: datagridview ? Pin
moomoooomoo1-Oct-07 4:21
moomoooomoo1-Oct-07 4:21 
GeneralRe: datagridview ? Pin
Dave Kreskowiak1-Oct-07 5:46
mveDave Kreskowiak1-Oct-07 5:46 
QuestionCurrent user input language Pin
Proqrammer1-Oct-07 3:15
Proqrammer1-Oct-07 3:15 
AnswerRe: Current user input language Pin
Gary Bigman1-Oct-07 5:14
Gary Bigman1-Oct-07 5:14 
QuestionCommunication between dlls Pin
Jens Johanneson1-Oct-07 2:58
Jens Johanneson1-Oct-07 2:58 
AnswerRe: Communication between dlls Pin
Dave Kreskowiak1-Oct-07 4:07
mveDave Kreskowiak1-Oct-07 4:07 
GeneralRe: Communication between dlls Pin
Jens Johanneson1-Oct-07 7:14
Jens Johanneson1-Oct-07 7:14 
GeneralRe: Communication between dlls Pin
Dave Kreskowiak1-Oct-07 12:00
mveDave Kreskowiak1-Oct-07 12:00 
QuestionResizing a form to suit the resolution Pin
Mr Oizo1-Oct-07 1:23
Mr Oizo1-Oct-07 1:23 
AnswerRe: Resizing a form to suit the resolution Pin
Christian Graus1-Oct-07 1:30
protectorChristian Graus1-Oct-07 1:30 
GeneralRe: Resizing a form to suit the resolution Pin
Mr Oizo1-Oct-07 5:16
Mr Oizo1-Oct-07 5:16 
GeneralRe: Resizing a form to suit the resolution Pin
Christian Graus1-Oct-07 11:04
protectorChristian Graus1-Oct-07 11:04 
GeneralRe: Resizing a form to suit the resolution Pin
Mr Oizo2-Oct-07 11:22
Mr Oizo2-Oct-07 11:22 
Questionhow to clear an array? Pin
moomoooomoo1-Oct-07 1:12
moomoooomoo1-Oct-07 1:12 
AnswerRe: how to clear an array? Pin
Luc Pattyn1-Oct-07 1:27
sitebuilderLuc Pattyn1-Oct-07 1:27 

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.