Sub oInsert() Dim ra As Integer Dim oDate As String = "03/03/2011" 'Date.Now.ToString Dim oText As String = "sqlclient" Dim oNumber As Decimal = 100 myConnection.Open() Dim sSQL As String sSQL = "Insert Into Table1 ([oDate],[oText], [oNumber]) Select '" & oDate & "' as Expr1, '" & oText & "' as Expr2, " & oNumber & " as Expr3" myCommand = New SqlCommand(sSQL, myConnection) ra = myCommand.ExecuteNonQuery() 'Since no value is returned we use ExecuteNonQuery MsgBox("Records Inserted " & ra) myConnection.Close() End Sub
|Exit the loop||4||37|
|VB.Net - Windows UserName index and length error||4||22|
|Need a starter for ETL protocol?||4||42|
|How to write a sql query returning a result with my date time template?||8||32|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!