473,473 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to display DB data in Windows application?

Tom
Hi

I want to display the DB data in a tabcontrol. There is a textbox insides that tabcontrol

<code
private void Bind_DBData(

string strSql = "select * from table WHERE id > 0 order by id"
DataSet ds = new DataSet()
tr

ds = SqlHelper.ExecuteDataset(DBConnection.ConnString,
CommandType.Text,
strSql)

catch(Exception
this.textBox1.Text += this.id + " " + this.content + " " + this.status
+
"\r\n"

</code

The above code only displays one row of record

In other web controls such as dropdownlist, radiobutton, checkboxlist, I can use the following to do data binding

//this.textBox1.DataSource = ds.Tables[0].DefaultView
//this.textBox1.DataTextField = "content"
//this.textBox1.DataValueField = "id"
//this.textBox1.DataBind()

However, how can I list all rows in DB table in a tabcontrol? Should I use textbox? I did not write window application before, thanks for help
Nov 16 '05 #1
1 2430
TextBox control is interested in displaying only one value hence reads only
one row. if you have to display all rows at a time, consider the option of
changing text box to drop down list.

"Tom" <ke*****@yahoo.com> wrote in message
news:73**********************************@microsof t.com...
Hi,

I want to display the DB data in a tabcontrol. There is a textbox insides
that tabcontrol.

<code>
private void Bind_DBData()
{
string strSql = "select * from table WHERE id > 0 order by id";
DataSet ds = new DataSet();
try
{
ds = SqlHelper.ExecuteDataset(DBConnection.ConnString,
CommandType.Text,
strSql);
}
catch(Exception)
{
}
this.textBox1.Text += this.id + " " + this.content + " " + this.status
+
"\r\n";
}
</code>

The above code only displays one row of record.

In other web controls such as dropdownlist, radiobutton, checkboxlist, I
can use the following to do data binding.

//this.textBox1.DataSource = ds.Tables[0].DefaultView;
//this.textBox1.DataTextField = "content";
//this.textBox1.DataValueField = "id";
//this.textBox1.DataBind();

However, how can I list all rows in DB table in a tabcontrol? Should I use
textbox? I did not write window application before, thanks for help.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: BOOGIEMAN | last post by:
Well that's it, how do I make Windows Application with Python ??? Is there simple way that works 100% ? How can I rework visual design done in VS 2003 to use it for my python program ?
7
by: Auto | last post by:
I starting to use Visual Studio .NET 2003 creating C# Windows application with SQL Server and I get problem with method Fill() for which when running ends with System Error even with the most...
1
by: dave | last post by:
I want to design/develop an windows application that can query multiple websites (XmlHttpRequest), call number of 3rd party external webservices (SOAP) and parse/process the data and display it to...
1
by: dave | last post by:
I want to design/develop an windows application (C#) that can query multiple websites (XmlHttpRequest), call number of 3rd party external webservices (SOAP) and parse/process the data and display...
1
by: lavu | last post by:
I currently have a C# windows Application . I would like this App to work through an command line interface also. I would like to specify command line params, which should start the app and process...
1
by: Gurunadh | last post by:
Hi friends, we have developed a windows desktop application in vb.net 2005 with MS-Access as backend ,our problem is we have to display data from a datagridview to a crystal report,we have...
1
by: Gurunadh | last post by:
Hi friends, we have developed a windows desktop application in vb.net 2005 with MS-Access as backend ,our problem is we have to display data from a datagridview to a crystal report,we have...
1
by: doug9149 | last post by:
Hello all. I'm trying to parse data stored in XML format into my Windows application using C#. I'd like specific XML Nodes listed in a TreeView. When the TreeView Nodes are clicked I need...
4
by: nmsreddi | last post by:
Hi friends , after a long busy work happy to back to forums, i have developed a windows application(C#2,0) for serial communication. the aim of my application is to connect to external...
9
by: Limno | last post by:
Hai, My windows application in C#.net should display time which is also running like System time. And i hv to check time as morning 10.00AM to next day morning 10.00AM. if this happen it...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.