473,320 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ASP.NET Web Interface Problems

34
Hi guys,

I posted my messages before and one of the members helped me a lot. Now I have another problem with the web Interface. I can populate the listboxes with tables from database.The code below populates one of the tables using a for each loop. I can also populate the tables without coding but I want the listboxes to look like a table with rows and columns. And after that I want to select values from each of the listboxes and a textbox to display information on another page. Could you guys help me how to do that. Here is the code.

protected void Page_Load(object sender, EventArgs e)
{
// create the connection string and command string

string connectionString = "Server=.\\SQLEXPRESS;Database=NorthWind;Integrate d Security=SSPI;";



string commandString = "Select * from Customers";
string commandString1 = "Select * from Orders";
string commandString2 = "Select * from Employees";
//pass the strings to the sql data adapter constructor

SqlDataAdapter dataAdapter = new SqlDataAdapter(commandString, connectionString);
SqlDataAdapter dataAdapter1 = new SqlDataAdapter(commandString1, connectionString);
SqlDataAdapter dataAdapter2 = new SqlDataAdapter(commandString2, connectionString);

// create a data set

DataSet dataSet = new DataSet();
// DataSet dataSet1 = new DataSet();
// fill the dataset object

dataAdapter.Fill(dataSet, "Customers");
//dataAdapter1.Fill(dataSet, "Orders");
//dataAdapter2.Fill(dataSet, "Employees");







// for loop for customer table

foreach (DataRow dtrow in dataSet.Tables["Customers"].Rows)
{
ListBox2.Items.Add(dtrow["CustomerID"].ToString());
ListBox2.Items.Add(dtrow["City"].ToString());
ListBox2.Items.Add(dtrow["CompanyName"].ToString());
ListBox2.Items.Add(dtrow["ContactName"].ToString());
}
}
Jan 13 '07 #1
1 1166
shweta123
692 Expert 512MB
Hi,
You can refer this http://www.codeproject.com/vb/net/mclb.asp

Shweta
Jan 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Stephan Rose | last post by:
Ok here is my scenario I have an interface called IScalar which describes a one dimensional number that has a certain unit of measurement. This interface is used to create multiple structures,...
4
by: jm | last post by:
Consider: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconwhenshouldiimplementinterfacesinmycomponent.asp // Code for the IAccount interface module. public...
21
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered...
6
by: Ricky W. Hunt | last post by:
It's dawning on my a lot of my problems with VB.NET is I'm still approaching it in the same way I've programmed since the late 70's. I've always been very structured, flow-charted everything, used...
2
by: Oenone | last post by:
I could use a little advice to help prevent me making a possible mess of a project. :) In VB6, I once created a project that exposed a public interface class. I then Implemented this in various...
4
by: Steven Cummings | last post by:
Hello, I'm currently developing on a large project where several assemblies build into DLLs that support the final .NET EXE. The original plan was to implement the project in VB.NET, so the EXE...
15
by: Gustaf | last post by:
Using VS 2005. I got an 'IpForm' class and an 'IpFormCollection' class, containing IpForm objects. To iterate through IpFrom objects with foreach, the class is implemented as such: public class...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
6
by: Chris Carlen | last post by:
Hi: I have an embedded system, platform: TI TMS320F2812 32-bit integer DSP. A module (.c file) contains external (to the funcs in that module) variables which are used to affect the operation...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.