Click here to Skip to main content
15,881,852 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Visual Basic and Access Database updating Pin
jbassmanp9-Jun-16 7:43
jbassmanp9-Jun-16 7:43 
QuestionApplication Portability Pin
BirderBob1-Jun-16 6:04
BirderBob1-Jun-16 6:04 
AnswerRe: Application Portability Pin
Dave Kreskowiak1-Jun-16 6:13
mveDave Kreskowiak1-Jun-16 6:13 
QuestionRecord does not get updated Pin
Raabi Anony30-May-16 18:19
Raabi Anony30-May-16 18:19 
AnswerRe: Record does not get updated Pin
Richard Deeming1-Jun-16 2:26
mveRichard Deeming1-Jun-16 2:26 
GeneralRe: Record does not get updated Pin
Raabi Anony1-Jun-16 16:34
Raabi Anony1-Jun-16 16:34 
GeneralRe: Record does not get updated Pin
Richard Deeming2-Jun-16 1:48
mveRichard Deeming2-Jun-16 1:48 
GeneralRe: Record does not get updated Pin
Raabi Anony2-Jun-16 17:02
Raabi Anony2-Jun-16 17:02 
Thanks, Richard, for your attention and sorry for leaving out a change in the code, for the test purpose, as below:
VB
Dim strUpdate As String = "UPDATE StaffName SET StaffName = 'Anonymous'" &  "WHERE StaffID = 1005"

A record with the StaffID = 1005 exists.
But the record doesn't get changed, as expected (by me Smile | :) ). What mistake I am doing.
Please suggest.
I have tried the following code, as well:
VB
Private Sub StaffInfoAdapterUpdate()
    Dim ConxnString As String = "Data Source=Dar-e-Arqam\SQLEXPRESS; Initial Catalog=StaffReport;
                                 Integrated Security=True"
    Dim Conxn As New SqlConnection(ConxnString)
    Dim cmd As SqlCommand = Conxn.CreateCommand()
    Dim StaffInfoDS As New DataSet()
    Dim StaffInfoAdapter As New SqlDataAdapter()
    Dim cmdText As String = "SELECT StaffID, StaffName, tblCampuses.CampusName, Designation,
                DOB, Gender, NIC, DateOfJoining
        FROM tblStaffInfo
        INNER JOIN tblCampuses
        ON tblStaffInfo.CampusID = tblCampuses.CampusID"
    Dim strUpdate As String = "UPDATE StaffName " &
                                 "SET StaffName = 'Anonymous' " & "WHERE StaffID = 1005"
    '                                     "SET StaffName = @StaffName " & "WHERE StaffID = @StaffID"
    Try
        Conxn.Open()
        cmd.CommandText = strUpdate
        cmd.ExecuteNonQuery()
        MsgBox("The record updated. Really?")
    Catch ex As Exception
        MsgBox("Error: " & ex.Message)
    End Try
End Sub

The above code throws an error: "Invalide object name 'StaffName'.
I am very disturbed for this problem.
Please help.

modified 2-Jun-16 23:26pm.

GeneralRe: Record does not get updated Pin
Chris Quinn2-Jun-16 21:06
Chris Quinn2-Jun-16 21:06 
GeneralRe: Record does not get updated Pin
Raabi Anony3-Jun-16 3:02
Raabi Anony3-Jun-16 3:02 
QuestionDynamic SQL generation is not supported against multiple base tables Pin
Raabi Anony29-May-16 17:17
Raabi Anony29-May-16 17:17 
AnswerRe: Dynamic SQL generation is not supported against multiple base tables Pin
Peter Leow29-May-16 17:57
professionalPeter Leow29-May-16 17:57 
GeneralRe: Dynamic SQL generation is not supported against multiple base tables Pin
Raabi Anony29-May-16 18:41
Raabi Anony29-May-16 18:41 
AnswerRe: Dynamic SQL generation is not supported against multiple base tables Pin
Mycroft Holmes29-May-16 22:19
professionalMycroft Holmes29-May-16 22:19 
GeneralRe: Dynamic SQL generation is not supported against multiple base tables Pin
Raabi Anony30-May-16 17:35
Raabi Anony30-May-16 17:35 
GeneralRe: Dynamic SQL generation is not supported against multiple base tables Pin
Mycroft Holmes30-May-16 19:08
professionalMycroft Holmes30-May-16 19:08 
GeneralRe: Dynamic SQL generation is not supported against multiple base tables Pin
Raabi Anony31-May-16 17:40
Raabi Anony31-May-16 17:40 
Questionadding values into a vb6 multiple-column list-box manually (in design time) Pin
Member 1250518129-May-16 9:27
Member 1250518129-May-16 9:27 
AnswerRe: adding values into a vb6 multiple-column list-box manually (in design time) Pin
Dave Kreskowiak29-May-16 18:42
mveDave Kreskowiak29-May-16 18:42 
AnswerRe: adding values into a vb6 multiple-column list-box manually (in design time) Pin
CHill601-Jun-16 0:50
mveCHill601-Jun-16 0:50 
QuestionAliasing Fieldnames and adding a calculation Field Pin
Raabi Anony27-May-16 18:10
Raabi Anony27-May-16 18:10 
AnswerRe: Aliasing Fieldnames and adding a calculation Field Pin
CHill6028-May-16 3:19
mveCHill6028-May-16 3:19 
AnswerRe: Aliasing Fieldnames and adding a calculation Field Pin
Dave Kreskowiak28-May-16 3:30
mveDave Kreskowiak28-May-16 3:30 
GeneralRe: Aliasing Fieldnames and adding a calculation Field Pin
Raabi Anony29-May-16 17:11
Raabi Anony29-May-16 17:11 
QuestionExcel view to datagridview migration Pin
Member 476123426-May-16 20:37
Member 476123426-May-16 20:37 

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.