Click here to Skip to main content
15,922,696 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How do I switch between forms by hiding the other Pin
DevQuest14-Apr-05 11:22
DevQuest14-Apr-05 11:22 
GeneralRe: How do I switch between forms by hiding the other Pin
Mitch F.14-Apr-05 14:24
Mitch F.14-Apr-05 14:24 
AnswerRe: How do I switch between forms by hiding the other Pin
rhenerlau19-Apr-05 17:19
rhenerlau19-Apr-05 17:19 
GeneralCrystal Report TextObject Pin
dpagka14-Apr-05 5:15
dpagka14-Apr-05 5:15 
Generalimage button Pin
Lisana14-Apr-05 3:18
Lisana14-Apr-05 3:18 
GeneralRe: image button Pin
Dave Kreskowiak14-Apr-05 4:15
mveDave Kreskowiak14-Apr-05 4:15 
GeneralRe: image button Pin
Lisana14-Apr-05 5:44
Lisana14-Apr-05 5:44 
GeneralRe: image button Pin
Dave Kreskowiak14-Apr-05 5:56
mveDave Kreskowiak14-Apr-05 5:56 
Lisana wrote:
I can't recall the function in the ImageButton1ClickHandler, what should I do?

If you want to call the code in the handler, just move the code to another method outside the handler.
Public Sub ImageButton1ClickHandler(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim results As Int32 = CType(CType(sender, Button).Name, Int32)
    BindDataSources(results)
End Sub

Public Sub BindDataSources(ByVal entityID As Int32)
    ' I'm assuming client_entityID is a "global" variable
    objConn.Open()
    Dim DA As New OleDbDataAdapter
    DA.SelectCommand = New OleDbCommand
    With DA.SelectCommand
        .Connection = objConn
        .CommandType = CommandType.Text
        .CommandText = "UPDATE Contacts set primary_contact = 0 WHERE client_entity_id = " & client_entityID
        .ExecuteNonQuery()
    End With
 
    Dim DA2 As New OleDbDataAdapter
    DA2.SelectCommand = New OleDbCommand
    With DA2.SelectCommand
        .Connection = objConn
        .CommandType = CommandType.Text
        .CommandText = "UPDATE Contacts set primary_contact = 1 WHERE entity_id = " & entityID
        .ExecuteNonQuery()
    End With
 
    objConn.Close()
End Sub

Now you can call BindDataSources from anywhere in your code, so long as you provide it an entityID.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: image button Pin
Lisana14-Apr-05 6:07
Lisana14-Apr-05 6:07 
GeneralRe: image button Pin
Dave Kreskowiak14-Apr-05 6:13
mveDave Kreskowiak14-Apr-05 6:13 
GeneralRe: image button Pin
Lisana14-Apr-05 6:17
Lisana14-Apr-05 6:17 
GeneralRe: image button Pin
Dave Kreskowiak14-Apr-05 8:17
mveDave Kreskowiak14-Apr-05 8:17 
GeneralRe: image button Pin
Lisana14-Apr-05 9:16
Lisana14-Apr-05 9:16 
GeneralRe: image button Pin
rwestgraham14-Apr-05 10:07
rwestgraham14-Apr-05 10:07 
GeneralRe: image button Pin
Lisana14-Apr-05 10:41
Lisana14-Apr-05 10:41 
GeneralRe: image button Pin
Dave Kreskowiak15-Apr-05 3:33
mveDave Kreskowiak15-Apr-05 3:33 
GeneralRe: image button Pin
Lisana15-Apr-05 3:42
Lisana15-Apr-05 3:42 
GeneralRe: image button Pin
Lisana14-Apr-05 6:19
Lisana14-Apr-05 6:19 
GeneralRe: image button Pin
rwestgraham14-Apr-05 9:47
rwestgraham14-Apr-05 9:47 
GeneralUsing Wavelet in VB Pin
Anonymous14-Apr-05 2:25
Anonymous14-Apr-05 2:25 
GeneralRe: Using Wavelet in VB Pin
Dave Kreskowiak14-Apr-05 3:49
mveDave Kreskowiak14-Apr-05 3:49 
GeneralHighlighting Datagrid specific items Pin
bibipopopopo14-Apr-05 1:26
bibipopopopo14-Apr-05 1:26 
GeneralRe: Highlighting Datagrid specific items Pin
Dave Kreskowiak14-Apr-05 3:45
mveDave Kreskowiak14-Apr-05 3:45 
GeneralMS chart control Pin
Mr Dabbah13-Apr-05 22:57
Mr Dabbah13-Apr-05 22:57 
GeneralMS Office document preview in windows form. Pin
satano66613-Apr-05 20:39
satano66613-Apr-05 20:39 

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.