473,322 Members | 1,806 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,322 software developers and data experts.

how to bind data (in dataset) to a textbox server control

i have dropdownlist with data. based on selected item(dropdownlist) i am retrieving data(single value) from database(sql server) using sqldataadapter and wanted to show this value in textbox. I want to know how to bind data to a textbox.
Thanx
sudha
Oct 8 '07 #1
3 1838
Sudha,

In CodeBehing use below code

DataSet ds = obj.DepartmentView(getqry.ToString()); // this is query string
DataTable dt = new DataTable();
dt = ds.Tables[0];
if (dt.Rows.Count > 0)
{
foreach (DataRow dr in dt.Rows)
{

EextBox2.Text = dr["DepartmentID"].ToString();
}
}
Oct 8 '07 #2
Plater
7,872 Expert 4TB
Hmmm. well. From your DataSet maybe something like this:
Expand|Select|Wrap|Line Numbers
  1. myTextBox.Text=myDataSet.Tables[0].Rows[0]["Mycolumn"].Value.ToString()
  2.  
Oct 8 '07 #3
Hmmm. well. From your DataSet maybe something like this:
Expand|Select|Wrap|Line Numbers
  1. myTextBox.Text=myDataSet.Tables[0].Rows[0]["Mycolumn"].Value.ToString()
  2.  
thanks a lot plater n arul. i took idea from arul's code n it came same as plater's code.
Oct 9 '07 #4

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

Similar topics

1
by: Chris Scragg | last post by:
Hi all: Through a Session variable, I am populating among other things the password field in a user's profile page (the Webform); this.TextBoxConfirmPassword.Text = Convert.ToString(Session);...
2
by: Vijaya | last post by:
Can we bind data to textbox in a headertemplate in a template column of a datagrid? If so please give some code snippets. Thank you
5
by: hanolo | last post by:
Does anyone ever see this happen. I build a form with couple of textbox server control. When user inputs character ` in there, after form post back, the textbox become a line of string such as...
4
by: Rich | last post by:
Hello, I have successfully created an oledbconnection (oleconn) to an Access mdb file along with an oleaDBdapter (oleda) and a dataset (ds1). If I loop through the dataset For i = 1 to 10...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
3
by: muthu | last post by:
Hi guys, Iam using a repeator control in my page.In wich i have dropdown list as the last column.I have a label in the first column.Now i have binded a datable to the repeator in the page load...
1
by: G | last post by:
Hello, Fairly new to .net (using c#). I am running an SQL query which always returns ONE ROW and no more. I would like to have the ID field of the returned row bound to a TextBox onSubmit. ...
1
by: dotnetguys | last post by:
Hi there, I want to pass textbox server control value through anchor tag to some other form how do i do Can somebody help me for this. Thanks
1
by: roblasch | last post by:
I have a server control that inherits a dropdownlist. I can't for the life of me get it to bind in a formview insert template. <TeamDD:TeamDropDownList ID="TeamID" runat="server"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: Shællîpôpï 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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.