473,465 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Have a problem with Database

Hi Everybody

I am reading data from access to dataset and I don't know how to show
it in a text box
this.oleDbConnection1 .Open ();
OleDbCommand cmd=this.oleDbConnection1 .CreateCommand ();
cmd.CommandText ="SELECT * FROM Manufactor ";
this.oleDbDataAdapterManufactor .SelectCommand =cmd ;
this.oleDbDataAdapterManufactor .Fill (this.dsManufactor1 );
this.oleDbConnection1 .Close();
for(int i=0;;i<this.dsManufactor1 .Tables [0].Rows .Count;i++ )
{
if (name=this.dsManufactor1 .Tables [0].Rows [i][0].ToString ())
{
textbox.text=this.dsManufactor1 .Tables [0].Rows [i][0].ToString ()
}
}
can some one help me
Liran
Nov 16 '05 #1
1 920
Liran:

A textbox can only display a single value at a time. You are looping
through all the rows so only the value in the last row will display.

Also, this line:
for(int i=0;;i<this.dsManufactor1 .Tables [0].Rows .Count;i++ )

Has an extra ';'.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 11 Nov 2004 23:30:47 -0800, li*****@hotmail.com (Lian) wrote:
Hi Everybody

I am reading data from access to dataset and I don't know how to show
it in a text box
this.oleDbConnection1 .Open ();
OleDbCommand cmd=this.oleDbConnection1 .CreateCommand ();
cmd.CommandText ="SELECT * FROM Manufactor ";
this.oleDbDataAdapterManufactor .SelectCommand =cmd ;
this.oleDbDataAdapterManufactor .Fill (this.dsManufactor1 );
this.oleDbConnection1 .Close();
for(int i=0;;i<this.dsManufactor1 .Tables [0].Rows .Count;i++ )
{
if (name=this.dsManufactor1 .Tables [0].Rows [i][0].ToString ())
{
textbox.text=this.dsManufactor1 .Tables [0].Rows [i][0].ToString ()
}
}
can some one help me
Liran


Nov 16 '05 #2

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

Similar topics

3
by: Dave | last post by:
Hey, I'm running a localhost web server...W2K with IIS 5.0, and I'm trying to use ASP/ADO to access my Access database. When I first load the page, everything works, but if i hit refresh (F5 or...
2
by: Robert Stearns | last post by:
After working well for most of a week, my application with the mysterious php/db2 problem is now failing again. No one has worked on the php code this week. We're running DB2 8.1.5, php 4.3.6...
5
by: Thames | last post by:
For the Configuration Assistant, why gave me such errors when I try to add remote database "sample" on linux (DB2 ESE UDB version 8)using "add database wizard" to my local DB server ...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
1
by: Brian Henry | last post by:
I am trying to make a custom user control that gets a list of users from our database and populates the list, its an owner drawn control also, the problem is, I placed the item onto a form and...
3
by: route_coder | last post by:
I am using access database to create a crystal report in VB.NET Everything works fine when I run on my machine. But when I am deploying it other windows machines. It is asking for database server...
2
by: Tony O'Bryan | last post by:
I am normally the admin for our PostgreSQL servers, but someone else tried to kill a runaway query while I was out sick. Unfortunately, he tried killing the runaway query by killing the...
5
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
7
by: yellr | last post by:
Hi, i've spent all resources, except this one. Hopefully anyone there out could help me with a idea for this problem. We have a db2 8.2 Enterprise Edition, on AIX 5.3 Platform, this is our...
3
by: Earl Anderson | last post by:
One of the users in our departmental db has Read/Write permissions to a particular form. He was able to access and edit the form at will until 2 weeks ago. His current problem was that he was not...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
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 ...

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.