Click here to Skip to main content
15,908,775 members
Home / Discussions / C#
   

C#

 
GeneralRe: - Solved. - ref GUID? Pin
Tristan Rhodes12-Mar-04 3:20
Tristan Rhodes12-Mar-04 3:20 
Generalfill a textbox from a dataset Pin
krisman11-Mar-04 4:43
krisman11-Mar-04 4:43 
Hi. This is probably real easy, but I just can't seem to figure it out. I have a dataset that returns a unique value. I would like to move that value to a textbox. No matter what I try, I can't get my code to fill the textbox.

I use a dataadapter, dataset, sqlcommand and sqlparm to read a sql2000 stored procedure. I put in the city name and get out the unique city id number we use. I've run teh stored procedure separately and I know it works. Do I databind the textbox to the dataset?

This is the code I'm currently using:
da = new SqlDataAdapter("ap_prs_frm_addr_urbn_cmty_id", addr_urbn_conn);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
ds = new DataSet();
SqlParameter addr_urbn_parm;

addr_urbn_parm = new SqlParameter("@cmty_desc", System.Data.SqlDbType.VarChar);
addr_urbn_parm.Direction = ParameterDirection.Input;
addr_urbn_parm.Value = ddlAddrUrbnCmty.SelectedItem.Text;

addr_urbn_parm = new SqlParameter("@cmty_id", System.Data.SqlDbType.VarChar);
addr_urbn_parm.Direction = ParameterDirection.Input;
addr_urbn_parm.Value = ds.ToString();
da.SelectCommand.Parameters.Add(addr_urbn_parm);

addr_urbn_conn.Open();
da.Fill(ds);
addr_urbn_conn.Close();

this.txtAddrUrbnCmtyID.DataBind();

Help!!!!!!!



Krisman
GeneralRe: fill a textbox from a dataset Pin
Guinness4Strength11-Mar-04 4:47
Guinness4Strength11-Mar-04 4:47 
GeneralRe: fill a textbox from a dataset Pin
krisman11-Mar-04 5:28
krisman11-Mar-04 5:28 
GeneralRe: fill a textbox from a dataset Pin
partyganger11-Mar-04 5:56
partyganger11-Mar-04 5:56 
GeneralRe: fill a textbox from a dataset Pin
Edbert P11-Mar-04 16:22
Edbert P11-Mar-04 16:22 
GeneralRe: fill a textbox from a dataset Pin
krisman15-Mar-04 2:56
krisman15-Mar-04 2:56 
GeneralRe: fill a textbox from a dataset Pin
Edbert P15-Mar-04 11:11
Edbert P15-Mar-04 11:11 
GeneralRe: fill a textbox from a dataset Pin
krisman16-Mar-04 2:51
krisman16-Mar-04 2:51 
GeneralWindows XP and Shell Pin
Guinness4Strength11-Mar-04 4:11
Guinness4Strength11-Mar-04 4:11 
GeneralRe: Windows XP and Shell Pin
Mike Dimmick12-Mar-04 2:28
Mike Dimmick12-Mar-04 2:28 
Generalprinting Pin
cmarmr11-Mar-04 4:01
cmarmr11-Mar-04 4:01 
GeneralRe: printing Pin
Not Active11-Mar-04 4:30
mentorNot Active11-Mar-04 4:30 
QuestionLock a file? Pin
Anonymous11-Mar-04 3:29
Anonymous11-Mar-04 3:29 
AnswerRe: Lock a file? Pin
Heath Stewart11-Mar-04 5:25
protectorHeath Stewart11-Mar-04 5:25 
AnswerRe: Lock a file? Pin
Manster11-Mar-04 5:46
Manster11-Mar-04 5:46 
GeneralRe: Lock a file? Pin
astanley12-Mar-04 2:06
sussastanley12-Mar-04 2:06 
GeneralRe: Lock a file? Pin
Heath Stewart12-Mar-04 3:11
protectorHeath Stewart12-Mar-04 3:11 
GeneralLicenseManager, LicenseProvider Pin
claude12345678911-Mar-04 3:11
claude12345678911-Mar-04 3:11 
GeneralRe: LicenseManager, LicenseProvider Pin
Heath Stewart11-Mar-04 4:47
protectorHeath Stewart11-Mar-04 4:47 
QuestionHow to use SetForegroundWindow in C#...?? Pin
Member 94012510-Mar-04 23:55
Member 94012510-Mar-04 23:55 
AnswerRe: How to use SetForegroundWindow in C#...?? Pin
Syed Abdul Khader11-Mar-04 2:05
Syed Abdul Khader11-Mar-04 2:05 
AnswerRe: How to use SetForegroundWindow in C#...?? Pin
Heath Stewart11-Mar-04 4:42
protectorHeath Stewart11-Mar-04 4:42 
GeneralRe: How to use SetForegroundWindow in C#...?? Pin
Member 94012511-Mar-04 15:58
Member 94012511-Mar-04 15:58 
GeneralRe: How to use SetForegroundWindow in C#...?? Pin
Heath Stewart12-Mar-04 2:58
protectorHeath Stewart12-Mar-04 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.