Click here to Skip to main content
15,887,135 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Display data from SQL into a form Pin
Pete O'Hanlon13-Nov-13 11:42
mvePete O'Hanlon13-Nov-13 11:42 
Questionwebtransform issue... anyone? Pin
Desvariovsk13-Nov-13 6:31
Desvariovsk13-Nov-13 6:31 
AnswerRe: webtransform issue... anyone? Pin
WuRunZhe17-Nov-13 21:21
WuRunZhe17-Nov-13 21:21 
GeneralRe: webtransform issue... anyone? Pin
Desvariovsk18-Nov-13 1:33
Desvariovsk18-Nov-13 1:33 
QuestionRe: webtransform issue... anyone? Pin
Eddy Vluggen21-Nov-13 7:28
professionalEddy Vluggen21-Nov-13 7:28 
QuestionRefreshing DGV after db (access 2007) changed Pin
jose mandurrino13-Nov-13 5:54
jose mandurrino13-Nov-13 5:54 
QuestionMessage Closed Pin
13-Nov-13 4:37
Member 1039931913-Nov-13 4:37 
QuestionSaving to DataBase Pin
Member 1038849412-Nov-13 2:14
Member 1038849412-Nov-13 2:14 
Hello everyone. I have been trying for a while to save records to sql.
i have created a database called SchoolDB. i hv the feild listed below in the table StudentInfo.
unfortunately i haven't succeeded. I tried many ways.

Here is one of them.

VB
Dim _cn As New SqlConnection
Dim _cnstring As String = "Data Source=ELIANE-VAIO\SQLEXPRESS;Initial Catalog=SchoolDB;Integrated Security=True;"
Dim _cn As New SqlConnection(_cnstring)
Dim cmd As New SqlCommand
'Try
_cn.Open()
cmd.Connection = _cn
cmd.CommandText = "INSERT INTO StudentInfo([Code], [Full-Name], [Position], [Title], [Phone-Number], [Address], [Date-Time]) VALUES('" & Form1.txtCode.Text & "', '" & Form1.txtName.Text & "', '" & Form1.cmbPosition.Text & "', '" & Form1.cmbTitle.Text & "','" & Form1.txtPhoneNumber.Text & "',' " & Form1.txtAddress.Text & "', '" & Form1.DateTimePicker1.Value & "');"
cmd.ExecuteNonQuery()


'Catch ex As Exception
' MessageBox.Show("Error while inserting record on table...")
'Finally
_cn.Close()
'End Try



Can you help me please :/

Any help would be appreciated
AnswerRe: Saving to DataBase Pin
Abhinav S12-Nov-13 2:27
Abhinav S12-Nov-13 2:27 
GeneralRe: Saving to DataBase Pin
Member 1038849412-Nov-13 2:30
Member 1038849412-Nov-13 2:30 
GeneralRe: Saving to DataBase Pin
Member 1038849412-Nov-13 2:34
Member 1038849412-Nov-13 2:34 
AnswerRe: Saving to DataBase Pin
Member 1038849412-Nov-13 2:35
Member 1038849412-Nov-13 2:35 
SuggestionRe: Saving to DataBase Pin
Richard Deeming12-Nov-13 2:59
mveRichard Deeming12-Nov-13 2:59 
QuestionRe: Saving to DataBase Pin
Eddy Vluggen12-Nov-13 9:00
professionalEddy Vluggen12-Nov-13 9:00 
AnswerRe: Saving to DataBase Pin
Richard Deeming12-Nov-13 9:08
mveRichard Deeming12-Nov-13 9:08 
GeneralRe: Saving to DataBase Pin
Eddy Vluggen12-Nov-13 9:09
professionalEddy Vluggen12-Nov-13 9:09 
GeneralRe: Saving to DataBase Pin
Richard Deeming12-Nov-13 9:19
mveRichard Deeming12-Nov-13 9:19 
GeneralRe: Saving to DataBase Pin
Member 1038849412-Nov-13 21:28
Member 1038849412-Nov-13 21:28 
GeneralRe: Saving to DataBase Pin
Richard Deeming13-Nov-13 2:27
mveRichard Deeming13-Nov-13 2:27 
GeneralMessage Closed Pin
13-Nov-13 2:41
Member 1038849413-Nov-13 2:41 
GeneralRe: Saving to DataBase (solved) Pin
Richard Deeming13-Nov-13 2:51
mveRichard Deeming13-Nov-13 2:51 
GeneralRe: Saving to DataBase (solved) Pin
Member 1038849413-Nov-13 3:03
Member 1038849413-Nov-13 3:03 
GeneralRe: Saving to DataBase (solved) Pin
Richard Deeming13-Nov-13 3:13
mveRichard Deeming13-Nov-13 3:13 
GeneralRe: Saving to DataBase (solved) Pin
Member 1038849413-Nov-13 3:21
Member 1038849413-Nov-13 3:21 
QuestionRe: Saving to DataBase Pin
Eddy Vluggen12-Nov-13 9:08
professionalEddy Vluggen12-Nov-13 9:08 

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.