How to use the Same DataReader to populate two different ListBoxes
You cannot use the same DataReader to populate 2 Listboxes.But can try out the below workaround VB.NET … cn = New SqlConnection(‘Server=localhost;uid=sa;database=northwind;pwd=’) cmd = New SqlCommand(‘select * from products;select * from products’, cn) cn.Open() dr = cmd.ExecuteReader() ListBox1.DataSource = dr ListBox1.DataTextField = ‘productname’ ListBox1.DataBind() dr.NextResult() ListBox2.DataSource = dr ListBox2.DataTextField = ‘productname’ ListBox2.DataBind() C# … cn = new SqlConnection(‘Server=localhost;uid=sa;database=northwind;pwd=’); cmd= new SqlCommand (‘select * from products;select * from products’, cn); cn.Open(); dr = cmd.ExecuteReader(); ListBox1.DataSource = dr; ListBox1.DataTextField = ‘productname’; ListBox1.DataBind(); dr.NextResult(); ListBox2.DataSource = dr; ListBox2.DataTextField = ‘productname’; ListBox2.DataBind();
How to add an attribute to the Table generated by the DataGrid
VB.NET ’Bind DataGrid DataGrid1.Attributes.Add (‘Description’, ‘This table displays Product Description’ ) C# //Bind DataGrid DataGrid1.Attributes.Add (‘Description’, ‘This table displays Product Description’ ); Note : By doing a ViewSource you can find the Attribute Description for the Table that displays the DataGrid data
When the User is prompted a File Download dialogbox, if the user selects ‘Save’ then the ‘Save as’ dialog box is displayed. Is there any way for me to retrieve the filename and directory path specified by the user on the File Download dialog box
Clients do not report information back about where the user selects to save the content, so there isn’t an easy way to do this. Instead, you would need to ask the user before using the content-disposition for a file path, and then you could specify the filename parameter for the content-disposition header. Still, the user is free to change that path when actually downloading.
What is the difference between Absolute vs Relative URLs
Absolute /Fully Qualified URLs: Contain all information necessary for the browser(or other client program) to locate the resource named in the URL This includes protocol moniker used( i.e http://, ftp://..etc..), Server’s Domain name or IP address and the file path Absolute URL looks as http://localhost/syncfusion/page1.aspx Relative URLs: Only provide information necessary to locate a resource relative to the current document(document relative) or current server or domain(root relative) Document relative URL – page1.aspx Root Relative URL – /syncfusion/Admin/pagelog.aspx
How to use a single DataReader associated with two different tables to databind two different listbox controls
VB.NET Dim cn As SqlConnection Dim cmd As SqlCommand Dim dr As SqlDataReader cn = New SqlConnection(‘Server=localhost;uid=sa;database=northwind;pwd=’) cmd = New SqlCommand(‘select * from products;select * from categories’, cn) cn.Open() dr = cmd.ExecuteReader() ListBox1.DataSource = dr ListBox1.DataTextField = ‘productname’ ListBox1.DataBind() dr.NextResult() ListBox2.DataSource = dr ListBox2.DataTextField = ‘categoryname’ ListBox2.DataBind() C# SqlConnection cn; SqlCommand cmd; SqlDataReader dr; cn = new SqlConnection(‘Server=localhost;uid=sa;database=northwind;pwd=’); cmd= new SqlCommand (‘select * from products;select * from categories’, cn); cn.Open(); dr = cmd.ExecuteReader(); ListBox1.DataSource = dr; ListBox1.DataTextField = ‘productname’; ListBox1.DataBind(); dr.NextResult(); ListBox2.DataSource = dr; ListBox2.DataTextField = ‘categoryname’; ListBox2.DataBind();