Click here to Skip to main content
15,921,622 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to INSERT multiple rows of data to sql table? Pin
zaimah31-Oct-12 2:28
zaimah31-Oct-12 2:28 
GeneralRe: How to INSERT multiple rows of data to sql table? Pin
Eddy Vluggen31-Oct-12 2:48
professionalEddy Vluggen31-Oct-12 2:48 
GeneralRe: How to INSERT multiple rows of data to sql table? Pin
zaimah31-Oct-12 3:01
zaimah31-Oct-12 3:01 
GeneralRe: How to INSERT multiple rows of data to sql table? Pin
Eddy Vluggen31-Oct-12 3:22
professionalEddy Vluggen31-Oct-12 3:22 
GeneralRe: How to INSERT multiple rows of data to sql table? Pin
zaimah31-Oct-12 3:53
zaimah31-Oct-12 3:53 
GeneralRe: How to INSERT multiple rows of data to sql table? Pin
Eddy Vluggen31-Oct-12 3:58
professionalEddy Vluggen31-Oct-12 3:58 
GeneralRe: How to INSERT multiple rows of data to sql table? Pin
zaimah31-Oct-12 4:17
zaimah31-Oct-12 4:17 
AnswerRe: How to INSERT multiple rows of data to sql table? Pin
Eddy Vluggen31-Oct-12 4:53
professionalEddy Vluggen31-Oct-12 4:53 
You don't insert a list, but a record; each record is an item in the list. You'd need to execute an insert-command (yup, still), something similar to this;
VB
Public Sub DoInsert()
    Using connection As New SqlConnection(connectionString) ' look up yours on www.connectionstrings.com
        Dim command As SqlCommand = connection.CreateCommand()
        command.Connection.Open() ' open the database
        ' command below needs a fitting insert-command, based on your tablestructure
        command.CommandText = "INSERT INTO [studenttablename] (StudName, StudAge) VALUES @StudName, @StudAge)" 

        command.Parameters.AddWithValue("@StudName", "Goku") ' put the value of the textbox here
        command.Parameters.AddWithValue("@StudAge", "9000+")

        command.ExecuteNonQuery()
    End Using 
End Sub

Do that for each item, and the list is "inserted" in the table.
Bastard Programmer from Hell Suspicious | :suss:
if you can't read my code, try converting it here[^]

GeneralRe: How to INSERT multiple rows of data to sql table? Pin
zaimah31-Oct-12 5:28
zaimah31-Oct-12 5:28 
GeneralRe: How to INSERT multiple rows of data to sql table? Pin
Eddy Vluggen31-Oct-12 6:20
professionalEddy Vluggen31-Oct-12 6:20 
AnswerRe: How to INSERT multiple rows of data to sql table? Pin
Andy_L_J15-Nov-12 20:14
Andy_L_J15-Nov-12 20:14 
AnswerRe: How to INSERT multiple rows of data to sql table? Pin
April Fans19-Dec-12 17:43
April Fans19-Dec-12 17:43 
QuestionMemory required by a form Pin
Gagnon Claude30-Oct-12 1:35
Gagnon Claude30-Oct-12 1:35 
AnswerRe: Memory required by a form Pin
Eddy Vluggen30-Oct-12 2:38
professionalEddy Vluggen30-Oct-12 2:38 
AnswerRe: Memory required by a form Pin
Dave Kreskowiak30-Oct-12 7:07
mveDave Kreskowiak30-Oct-12 7:07 
GeneralRe: Memory required by a form Pin
Gagnon Claude30-Oct-12 13:24
Gagnon Claude30-Oct-12 13:24 
GeneralRe: Memory required by a form Pin
Dave Kreskowiak30-Oct-12 13:45
mveDave Kreskowiak30-Oct-12 13:45 
QuestionWhy can't i find a consistent set of examples for SQL and Linq Pin
Gerald Connolly29-Oct-12 11:51
Gerald Connolly29-Oct-12 11:51 
AnswerRe: Why can't i find a consistent set of examples for SQL and Linq Pin
Eddy Vluggen30-Oct-12 1:12
professionalEddy Vluggen30-Oct-12 1:12 
GeneralRe: Why can't i find a consistent set of examples for SQL and Linq Pin
Gerald Connolly30-Oct-12 3:42
Gerald Connolly30-Oct-12 3:42 
GeneralRe: Why can't i find a consistent set of examples for SQL and Linq Pin
Eddy Vluggen30-Oct-12 4:05
professionalEddy Vluggen30-Oct-12 4:05 
QuestionAttempted to read or write protected memory. This is often an indication that other memory is corrupt. Pin
Kimhoy25-Oct-12 17:57
Kimhoy25-Oct-12 17:57 
AnswerRe: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Pin
Dave Kreskowiak25-Oct-12 18:29
mveDave Kreskowiak25-Oct-12 18:29 
GeneralRe: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Pin
Kimhoy25-Oct-12 19:37
Kimhoy25-Oct-12 19:37 
GeneralRe: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Pin
Dave Kreskowiak26-Oct-12 2:20
mveDave Kreskowiak26-Oct-12 2:20 

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.