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

.NET (Core and Framework)

 
Questionstart working with web application Pin
AnojAnu19-Dec-13 19:00
AnojAnu19-Dec-13 19:00 
AnswerRe: start working with web application Pin
Mycroft Holmes19-Dec-13 19:09
professionalMycroft Holmes19-Dec-13 19:09 
AnswerRe: start working with web application Pin
Richard MacCutchan19-Dec-13 21:40
mveRichard MacCutchan19-Dec-13 21:40 
QuestionOne button submit that handles the work with the database Pin
Member 1038849419-Dec-13 0:03
Member 1038849419-Dec-13 0:03 
AnswerRe: One button submit that updates my database(insert,delete,..) without using DataAdapter Pin
Member 1038849419-Dec-13 1:35
Member 1038849419-Dec-13 1:35 
GeneralRe: One button submit that updates my database(insert,delete,..) without using DataAdapter Pin
Dave Kreskowiak19-Dec-13 2:00
mveDave Kreskowiak19-Dec-13 2:00 
GeneralRe: One button submit that updates my database(insert,delete,..) without using DataAdapter Pin
Member 1038849419-Dec-13 2:02
Member 1038849419-Dec-13 2:02 
GeneralRe: One button submit that updates my database(insert,delete,..) without using DataAdapter Pin
Dave Kreskowiak19-Dec-13 3:12
mveDave Kreskowiak19-Dec-13 3:12 
GeneralRe: One button submit that updates my database(insert,delete,..) without using DataAdapter Pin
Edward Giles19-Dec-13 22:27
Edward Giles19-Dec-13 22:27 
AnswerRe: One button submit that handles the work with the database Pin
Eddy Vluggen19-Dec-13 8:09
professionalEddy Vluggen19-Dec-13 8:09 
GeneralRe: One button submit that handles the work with the database Pin
Member 1038849419-Dec-13 8:16
Member 1038849419-Dec-13 8:16 
GeneralRe: One button submit that handles the work with the database Pin
Richard Deeming19-Dec-13 8:47
mveRichard Deeming19-Dec-13 8:47 
GeneralRe: One button submit that handles the work with the database Pin
Member 1038849419-Dec-13 9:38
Member 1038849419-Dec-13 9:38 
GeneralRe: One button submit that handles the work with the database Pin
Member 1038849420-Dec-13 7:24
Member 1038849420-Dec-13 7:24 
GeneralRe: One button submit that handles the work with the database Pin
Eddy Vluggen20-Dec-13 7:38
professionalEddy Vluggen20-Dec-13 7:38 
GeneralRe: One button submit that handles the work with the database Pin
Dave Kreskowiak19-Dec-13 9:29
mveDave Kreskowiak19-Dec-13 9:29 
Questionsyntax error while updating a record Pin
Member 1038849418-Dec-13 3:07
Member 1038849418-Dec-13 3:07 
AnswerRe: syntax error while updating a record Pin
Pete O'Hanlon18-Dec-13 3:39
mvePete O'Hanlon18-Dec-13 3:39 
GeneralRe: syntax error while updating a record Pin
Member 1038849418-Dec-13 3:57
Member 1038849418-Dec-13 3:57 
VB
Private Sub cmdUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click
        Dim strconnection As String = "Data Source=ELIANE-VAIO\SQLEXPRESS;Initial Catalog=DatabaseConnection;Integrated Security=True;"
        Dim _cn As SqlConnection = New SqlConnection(strconnection)
        Dim cmd As New SqlCommand
        _cn.Open()

        cmd.CommandText = "update tblcustomer set ([ID],[Name],[Email], [Address], [DeptID]) VALUES (<a href="/Members/id">@ID</a>, <a href="/Members/Name">@Name</a>, <a href="/Members/email">@Email</a>, <a href="/Members/address">@Address</a>, @DeptID)"
        cmd.Connection = _cn
        cmd.Parameters.AddWithValue("<a href="/Members/id">@ID</a>", Me.txtID.Text)
        cmd.Parameters.AddWithValue("<a href="/Members/Name">@Name</a>", Me.txtName.Text)
        cmd.Parameters.AddWithValue("<a href="/Members/email">@Email</a>", Me.txtEmail.Text)
        cmd.Parameters.AddWithValue("<a href="/Members/address">@Address</a>", Me.txtAddress.Text)
        cmd.Parameters.AddWithValue("@DeptID", Me.cbDept.SelectedValue)
        txtserial.Text = cmd.ExecuteScalar()
End Sub


I wrote this one now. But it's giving me error on the executescalar. syntax error near )
Am i missing something?
And if i commented this line of code:
VB
txtserial.Text = cmd.ExecuteScalar()

when i edit the textboxes , everything looks normal. i go next-previous-move last-move first. everything is fine. but not the database.
the edited record stays as it was before editing.
Any idea why?
Thank you Smile | :)
GeneralRe: syntax error while updating a record Pin
Pete O'Hanlon18-Dec-13 4:00
mvePete O'Hanlon18-Dec-13 4:00 
GeneralRe: syntax error while updating a record Pin
Member 1038849418-Dec-13 4:03
Member 1038849418-Dec-13 4:03 
GeneralRe: syntax error while updating a record Pin
Pete O'Hanlon18-Dec-13 4:10
mvePete O'Hanlon18-Dec-13 4:10 
GeneralRe: syntax error while updating a record Pin
Richard Deeming18-Dec-13 4:13
mveRichard Deeming18-Dec-13 4:13 
GeneralRe: syntax error while updating a record Pin
Member 1038849418-Dec-13 4:24
Member 1038849418-Dec-13 4:24 
GeneralRe: syntax error while updating a record Pin
Pete O'Hanlon18-Dec-13 4:38
mvePete O'Hanlon18-Dec-13 4:38 

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.