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

Visual Basic

 
QuestionRe: Help with Message Box Colors Pin
JRay565929-May-06 12:40
JRay565929-May-06 12:40 
Questionhelp me Pin
bawades27-May-06 5:38
bawades27-May-06 5:38 
Questionhelp me Pin
bawades27-May-06 5:06
bawades27-May-06 5:06 
AnswerRe: help me Pin
Guffa27-May-06 5:23
Guffa27-May-06 5:23 
AnswerRe: help me Pin
HaloZa28-May-06 8:38
HaloZa28-May-06 8:38 
AnswerRe: help me Pin
FrankyT28-May-06 21:24
FrankyT28-May-06 21:24 
QuestionTo insert a new record in asp.net Pin
ADY00727-May-06 4:35
ADY00727-May-06 4:35 
AnswerRe: To insert a new record in asp.net Pin
Colin Angus Mackay27-May-06 6:16
Colin Angus Mackay27-May-06 6:16 
ADY007 wrote:
To insert a new record in asp.net


It is ADO.NET that is the part of the .NET Framework that deals with databases. ASP.NET is the part of the .NET Framework that deals with web applications.


ADY007 wrote:
can someone tell me how to insert a new record. i have 2 values and i want them to be saved in the database.


There are many ways to insert data into the database here is one:
Dim conn As SqlConnection = New SqlConnection(connectionString)
Dim cmd As SqlCommand = New SqlCommand()
cmd.CommandText = "INSERT MyTable(Column1, Column2) VALUES (@value1, @value2)"
cmd.Parameters.Add("@value1", firstValue)
cmd.Parameters.Add("@value2", secondValue)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()


Assumptions:
* You are using SQL Server
* You have a connection string already called connectionString
* You have a table called MyTable
* MyTable has two columns called Column1 and Column2
* The values you wish to insert are stored in variables called firstValue and secondValue


"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)

My: Website | Blog
GeneralRe: To insert a new record in asp.net Pin
ADY00727-May-06 9:18
ADY00727-May-06 9:18 
GeneralRe: To insert a new record in asp.net Pin
Colin Angus Mackay27-May-06 9:32
Colin Angus Mackay27-May-06 9:32 
GeneralRe: To insert a new record in asp.net [modified] Pin
ADY00727-May-06 10:22
ADY00727-May-06 10:22 
GeneralRe: To insert a new record in asp.net [modified] Pin
Colin Angus Mackay27-May-06 10:34
Colin Angus Mackay27-May-06 10:34 
GeneralRe: To insert a new record in asp.net Pin
ADY00727-May-06 11:13
ADY00727-May-06 11:13 
GeneralRe: To insert a new record in asp.net Pin
Colin Angus Mackay27-May-06 11:16
Colin Angus Mackay27-May-06 11:16 
GeneralRe: To insert a new record in asp.net Pin
ADY00727-May-06 11:22
ADY00727-May-06 11:22 
GeneralRe: To insert a new record in asp.net Pin
ADY00727-May-06 11:23
ADY00727-May-06 11:23 
GeneralRe: To insert a new record in asp.net Pin
ADY00727-May-06 11:57
ADY00727-May-06 11:57 
GeneralRe: To insert a new record in asp.net Pin
Colin Angus Mackay27-May-06 13:52
Colin Angus Mackay27-May-06 13:52 
GeneralRe: To insert a new record in asp.net Pin
ADY00727-May-06 14:14
ADY00727-May-06 14:14 
GeneralRe: To insert a new record in asp.net Pin
Colin Angus Mackay27-May-06 14:49
Colin Angus Mackay27-May-06 14:49 
GeneralRe: To insert a new record in asp.net Pin
ADY00729-May-06 10:39
ADY00729-May-06 10:39 
GeneralRe: To insert a new record in asp.net Pin
Colin Angus Mackay29-May-06 12:19
Colin Angus Mackay29-May-06 12:19 
QuestionUpdate cookies Pin
J Liang27-May-06 3:16
J Liang27-May-06 3:16 
AnswerRe: Update cookies Pin
Guffa27-May-06 4:00
Guffa27-May-06 4:00 
GeneralRe: Update cookies Pin
J Liang27-May-06 4:49
J Liang27-May-06 4:49 

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.