Hi, if i want to use a input box that prompt user to key in the table name and show that data in data grid.
I have try this but can't work, so is there any alternatives?
i assign the value get from the input box to Myalue. Then i using the select query: select date, number from MyValue; i also try select date, number from '" & MyValue & "' .... both also can't work..
besides that, if i key in the table name without input box, it works but i cannot include open attribute but if i put * then all attribute can show include open attribute.
Anyone can advise me on this? the code is like below:
I have try this but can't work, so is there any alternatives?
i assign the value get from the input box to Myalue. Then i using the select query: select date, number from MyValue; i also try select date, number from '" & MyValue & "' .... both also can't work..
besides that, if i key in the table name without input box, it works but i cannot include open attribute but if i put * then all attribute can show include open attribute.
Anyone can advise me on this? the code is like below:
VB.NET:
Dim myValue As String
' message = "Enter a stock name"
'title = "InputBox Demo"
'defaultValue = "Maxis"
'myValue = InputBox(message, title, defaultValue)
'If myValue Is "" Then
myValue = "Maxis"
OleAdapt = New OleDb.OleDbDataAdapter("Select * from '" & myValue & "'", ConOleDB)
OleAdapt.Fill(DsAllStock, "'" & myValue & "'")
DataGrid1.DataSource = DsAllStock.Tables("'" & myValue & "'")
DataGrid1.CaptionText = "Record No." & DataGrid1.CurrentRowIndex + 1 & " of 0" & DsAllStock.Tables("'" & myValue & "'").Rows.Count
Last edited by a moderator: