Click here to Skip to main content
15,891,976 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: MySQL/VB.NET Interaction Pin
Tamimi - Code8-Jan-07 19:21
Tamimi - Code8-Jan-07 19:21 
GeneralRe: MySQL/VB.NET Interaction Pin
jayemsee2838-Jan-07 19:51
jayemsee2838-Jan-07 19:51 
Questionhelp on windows process Pin
gladsmhe8-Jan-07 16:13
gladsmhe8-Jan-07 16:13 
AnswerRe: help on windows process Pin
nlarson119-Jan-07 5:34
nlarson119-Jan-07 5:34 
QuestionHow to detedt a socket client connection loss in TCP Listener? [modified] Pin
keithyang8-Jan-07 15:59
keithyang8-Jan-07 15:59 
QuestionV.B 6 Pin
J.Paul Ghetty8-Jan-07 15:12
J.Paul Ghetty8-Jan-07 15:12 
AnswerRe: V.B 6 Pin
Christian Graus8-Jan-07 15:21
protectorChristian Graus8-Jan-07 15:21 
QuestionDatagrid - Refresh Pin
Larry White8-Jan-07 11:19
Larry White8-Jan-07 11:19 
Confused | :confused: Any help would be appreciated.

I am trying to design my form to display the data using a Selected Value from a listbox. I set the lbShop.SelectedIndexChanged event to refresh the datagrid when a new value is selected. The variable SShop1 is changed correctly as each item in the listbox is selected, but the datagrid will not refresh using the SQL Select string. What I need is the new SQL Select command to run with the user selected variable, clear the datagrid, and display the data from the new SQL string.

Private Sub frmAllOpenbyShop_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

cnn.Open()
reader = dr5.ExecuteReader()
While reader.Read()
values.Add(reader.Item("Shops").ToString())
End While
lbShop.DataSource = values
reader.Close()

Try
'Attempt to load the dataset.
Me.loadDoc()
Catch eLoad As System.Exception
'Add your error handling code here.
'Display error message, if any.
System.Windows.Forms.MessageBox.Show(eLoad.Message)
End Try
End Sub
*******************************************************************************
Public Sub dadapt1()
SShop1 = lbShop.SelectedItem
DAdapt.SelectCommand = New SqlCommand
DAdapt.SelectCommand.CommandType = CommandType.Text
DAdapt.SelectCommand.Connection = cnn1
DAdapt.SelectCommand.CommandText = "Select SystemName, Shop, ActionTaken, TaskNotes, Symptoms, TroubleShooting, Conclusion FROM Workorders WHERE TaskNotes LIKE '" & SShop1 & "' ORDER BY Shop"
End Sub
*******************************************************************************
Public Sub loadDoc()
Me.dadapt1()
Try
dsSearch2.Clear()
DAdapt.Fill(dsSearch2)
Catch ex As SqlException
End Try
grdWorkorders.DataSource = dsSearch2
End Sub
*******************************************************************************
Private Sub lbShop_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbShop.SelectedIndexChanged
grdWorkorders.Refresh()
Me.loadDoc()
End Sub

LWhite
AnswerRe: Datagrid - Refresh Pin
Christian Graus8-Jan-07 12:49
protectorChristian Graus8-Jan-07 12:49 
GeneralRe: Datagrid - Refresh Pin
Larry White9-Jan-07 4:53
Larry White9-Jan-07 4:53 
QuestionMDI Forms Pin
Jason Timothy Holland8-Jan-07 10:01
Jason Timothy Holland8-Jan-07 10:01 
AnswerRe: MDI Forms Pin
Dave Kreskowiak8-Jan-07 10:09
mveDave Kreskowiak8-Jan-07 10:09 
QuestionEncrypt File using User Supplied Password Pin
hkinser98-Jan-07 9:57
hkinser98-Jan-07 9:57 
QuestionPrinting landscape pages not working Pin
Knoen8-Jan-07 9:39
Knoen8-Jan-07 9:39 
QuestionDataGridView.Columns.AddRange Pin
kindman_nb8-Jan-07 9:10
kindman_nb8-Jan-07 9:10 
AnswerRe: DataGridView.Columns.AddRange Pin
Dave Kreskowiak8-Jan-07 9:20
mveDave Kreskowiak8-Jan-07 9:20 
GeneralRe: DataGridView.Columns.AddRange Pin
kindman_nb8-Jan-07 10:39
kindman_nb8-Jan-07 10:39 
GeneralRe: DataGridView.Columns.AddRange Pin
Dave Kreskowiak9-Jan-07 2:53
mveDave Kreskowiak9-Jan-07 2:53 
GeneralRe: DataGridView.Columns.AddRange Pin
kindman_nb9-Jan-07 7:25
kindman_nb9-Jan-07 7:25 
QuestionShared Printer (send it a string) Pin
oogyboogyme8-Jan-07 9:02
oogyboogyme8-Jan-07 9:02 
AnswerRe: Shared Printer (send it a string) Pin
Dave Kreskowiak8-Jan-07 9:17
mveDave Kreskowiak8-Jan-07 9:17 
QuestionImage Comparision Pin
ParticleBoy8-Jan-07 8:11
ParticleBoy8-Jan-07 8:11 
AnswerRe: Image Comparision Pin
Christian Graus8-Jan-07 9:13
protectorChristian Graus8-Jan-07 9:13 
QuestionDatabase Error Pin
Karma312518-Jan-07 8:06
Karma312518-Jan-07 8:06 
AnswerRe: Database Error Pin
Dave Kreskowiak8-Jan-07 9:13
mveDave Kreskowiak8-Jan-07 9:13 

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.