August 7, 2004
You could use user input to query the database for only
certain items
or rows that have certain values in their columns. Your code could
look
something like this:
dim querystring as string
querystring = "SELECT * FROM DATABASE WHERE columnname='" & _
userinput & "'"
dim cmd as new Data.SqlClient.SqlCommand(querystring, connection)
dim reader as new data.sqlclient.sqldatareader
connection.open
reader = cmd.executereader
connection.close
You can then use the reader to create rows in your datagrid. Be very
careful of SQL Injection attacks!!!!!!!!!!! You might use regular
expressions
to check the user input. That then brings up the subject of
canonicalization
issues. Good luck!
Joseph
"dzemo" wrote:
I have about 50000 records in table in SQL. Which is the fastes way to
display data on form. I had used DataReader & litview but it takes 20
seconds or more to populated data. Any suggestions?
thx