Click here to Skip to main content
15,908,775 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to create a text box that accepts only numbers and full stop in VB.Net Pin
Johan Hakkesteegt7-Jun-09 21:16
Johan Hakkesteegt7-Jun-09 21:16 
GeneralRe: How to create a text box that accepts only numbers and full stop in VB.Net Pin
tiagu8-Jun-09 0:33
tiagu8-Jun-09 0:33 
GeneralRe: How to create a text box that accepts only numbers and full stop in VB.Net Pin
Johan Hakkesteegt8-Jun-09 0:43
Johan Hakkesteegt8-Jun-09 0:43 
AnswerRe: How to create a text box that accepts only numbers and full stop in VB.Net Pin
Kschuler8-Jun-09 7:57
Kschuler8-Jun-09 7:57 
QuestionAmazing !!! Problem (SQL Insert Command - SqlServer 2005) Pin
Paramu19737-Jun-09 1:10
Paramu19737-Jun-09 1:10 
AnswerRe: Amazing !!! Problem (SQL Insert Command - SqlServer 2005) Pin
Moreno Airoldi7-Jun-09 1:33
Moreno Airoldi7-Jun-09 1:33 
GeneralRe: Amazing !!! Problem (SQL Insert Command - SqlServer 2005) Pin
Paramu19737-Jun-09 1:49
Paramu19737-Jun-09 1:49 
GeneralRe: Amazing !!! Problem (SQL Insert Command - SqlServer 2005) Pin
Moreno Airoldi7-Jun-09 2:04
Moreno Airoldi7-Jun-09 2:04 
If I undestand correctly what you are trying to do, an example could be:

VB
Dim Save_4 As String = "insert into itemmst (itm_description) values (@itm_description)"
Dim com As SqlCommand = New SqlCommand(Save_4, con)

Dim par As SqlParameter = New SqlParameter("itm_description", SqlDbType.Text, 255, ParameterDirection.Input, False, 0, 0, "itm_description", DataRowVersion.Current, itm_description)
com.Parameters.Add(par)

con.Open()

Dim Trans As SqlTransaction
Trans = con.BeginTransaction
com.Transaction = Trans

Try
    com.ExecuteNonQuery()
    Trans.Commit()

Catch ex As Exception
    If Not Trans Is Nothing Then
        Trans.Rollback()
    End If
    MsgBox(ex.Message)
End Try

con.Close()


Please have a look at the documentation for the SqlParameter class, in order to apply the correct values to all parameters for your specific needs.

If you need to do something more complex, like for example reading the data into a dataset, binding it to some UI controls, modifying it and then applying the modifications to the DB, you can have a deeper look at the SqlDataAdapter class. It has methods to automatically build your select/insert/update/delete commands and managing modifications to your datasets. You can have a look at one of the many good articles about ADO.NET on the web.

2+2=5 for very large amounts of 2
(always loved that one hehe!)

QuestionHow do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Graham Irons6-Jun-09 22:17
Graham Irons6-Jun-09 22:17 
AnswerRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Christian Graus7-Jun-09 0:09
protectorChristian Graus7-Jun-09 0:09 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Graham Irons7-Jun-09 1:29
Graham Irons7-Jun-09 1:29 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Mycroft Holmes7-Jun-09 3:09
professionalMycroft Holmes7-Jun-09 3:09 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Graham Irons7-Jun-09 12:58
Graham Irons7-Jun-09 12:58 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Mycroft Holmes7-Jun-09 14:14
professionalMycroft Holmes7-Jun-09 14:14 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Graham Irons7-Jun-09 16:52
Graham Irons7-Jun-09 16:52 
QuestionIs it possible to create controls from a new thread in a multithreading windows form application Pin
Amer Rehman6-Jun-09 21:31
Amer Rehman6-Jun-09 21:31 
AnswerRe: Is it possible to create controls from a new thread in a multithreading windows form application Pin
Moreno Airoldi7-Jun-09 1:30
Moreno Airoldi7-Jun-09 1:30 
AnswerRe: Is it possible to create controls from a new thread in a multithreading windows form application Pin
Dave Kreskowiak7-Jun-09 7:18
mveDave Kreskowiak7-Jun-09 7:18 
Questionimage loop in vb.net Pin
bapu28896-Jun-09 11:56
bapu28896-Jun-09 11:56 
AnswerRe: image loop in vb.net Pin
Alan N6-Jun-09 12:23
Alan N6-Jun-09 12:23 
QuestionRe: image loop in vb.net Pin
bapu28896-Jun-09 23:21
bapu28896-Jun-09 23:21 
AnswerRe: image loop in vb.net Pin
Alan N7-Jun-09 0:34
Alan N7-Jun-09 0:34 
AnswerRe: image loop in vb.net Pin
0x3c06-Jun-09 23:36
0x3c06-Jun-09 23:36 
QuestionRe: image loop in vb.net Pin
bapu28897-Jun-09 0:20
bapu28897-Jun-09 0:20 
AnswerRe: image loop in vb.net Pin
riced7-Jun-09 0:51
riced7-Jun-09 0:51 

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.