salmani Posted September 17, 2003 Posted September 17, 2003 I am using select statement for displaying all of the users in the Categories table of Northwind Database. But in return, nothing is displaying on the page. CAn any one help Regards Salman Iqbal --------------- Select Statement for Northwind Database -------------- <%@ Page Language="vb"%> <%@ Import Namespace="System.Data.SqlClient" %> <HTML> <HEAD> <title>Dropdown Binding</title> <script runat="server"> Sub Page_load Dim conPubs as SqlConnection Dim cmdSelect as SqlCommand Dim dtrAuthors as SqlDataReader conPubs = New SqlConnection("Server=WIN2K3\OMER; UID=sa; PWD=sa; database=Northwind") conPubs.Open() cmdSelect = New SqlCommand("Select name from categories", conPubs) dtrAuthors=cmdSelect.ExecuteReader() End Sub </script> </HEAD> <body MS_POSITIONING="GridLayout"> <form runat="server" ID="Form1"> </form> </body> </HTML> ********************************** Quote
bungpeng Posted September 17, 2003 Posted September 17, 2003 You were get your result, but where do you want it to display? I will suggest you bind your data to dropdownlist server control. P/S: You can use your "dtrAuthors" DataReader to bind to your dropdownlist server control Quote
salmani Posted September 17, 2003 Author Posted September 17, 2003 But i want to display it in some table format rather than dropdown list control.. So for this, what should i do Quote
bungpeng Posted September 17, 2003 Posted September 17, 2003 You can also use other server controls like "DataGrid", "Repeater".... Another way is manually form your own HTML table and use "Response.write" to send your source to Client site Quote
salmani Posted September 17, 2003 Author Posted September 17, 2003 Ok.. I will use repeater, data list or data grid control and let u know the results... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.