Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Event handling
Message
From
01/10/2003 17:55:25
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
30/09/2003 21:08:38
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00833676
Message ID:
00834002
Views:
32
>In a webform in vb.net how do i put an sql statement inside an event handler?
>Are there further implications(code)in the rest of the program?
>How do I get the event to generate labels of a database name or field for the results of the sql statement?

Troy,

See the classes in the SqlClient namespace for examples of how to execute an sql statement. There is no difference between executing sql commands inside of an event handler or inside a method of the page class.

The results of your sql statement will normally return a rowset (similar to an ADO recordset). The database name will already be specified in your connection string, or in the sql statement that you are executing. For field names, you can use an SqlDataAdapter to retrieve the rowset as a DataTable or a DataSet that contains DataTables. The DataTable will contain a DataColumn for each field in the rowset that can be accessed by column name or index position. To dynamically determine the names of the columns, use a For..Next statement to examine the ColumnName property of the DataTable.Columns collection.
Previous
Reply
Map
View

Click here to load this message in the networking platform