473,320 Members | 2,162 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.

types and untyped dataset and access the right columns

hi i have a couple of questions:
1) what is the difference between type and untyped dataset - i would like t
ouse the typed dataset to take adv of intellisense- but the dataset i have
created seems untyped -
herei s my code -
//create myConn to the db and my Select query and execite
SqlConnection myConn = new SqlConnection("");
SqlCommand mySelectCommand = new SqlCommand("SELECT ContactPassword
ContactUserID FROM TABLE WHERE (ContactUserID = @emailAddress)");
mySelectCommand.Connection = myConn;

// let it know about that paramter
mySelectCommand.Parameters.Add(new SqlParameter("@emailAddress",
SqlDbType.VarChar, 50));

//create a sql data adapter
SqlDataAdapter myDataAdapter = new SqlDataAdapter();
myDataAdapter.SelectCommand = mySelectCommand;

//assign the param to the sql params
myDataAdapter.SelectCommand.Parameters["@emailAddress"].Value =
this.TextBoxEmailaddr.Text.Trim();
myConn.Open();

// create a dataset
DataSet myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet);
myConn.Close()

2) how do i access a column field called : contactPassword in my Table

this.lblPassword.Text =
myDataSet.Tables["TABLE_Contact_Info"].Rows[0]["contactPassword"].ToString();

IT IS NOT working please help thx in advance
Nov 18 '05 #1
1 1727
For the difference about typed datasets
Please read it @ http://www.sevder.com/default.aspx?show=HowTO.NET
About #2. Give more details like the error message or don't you get
anything at all. (You may loose your dataset in a postback)

--

SevDer
http://www.sevder.com
nabil m wrote:
hi i have a couple of questions:
1) what is the difference between type and untyped dataset - i would like t
ouse the typed dataset to take adv of intellisense- but the dataset i have
created seems untyped -
herei s my code -
//create myConn to the db and my Select query and execite
SqlConnection myConn = new SqlConnection("");
SqlCommand mySelectCommand = new SqlCommand("SELECT ContactPassword
ContactUserID FROM TABLE WHERE (ContactUserID = @emailAddress)");
mySelectCommand.Connection = myConn;

// let it know about that paramter
mySelectCommand.Parameters.Add(new SqlParameter("@emailAddress",
SqlDbType.VarChar, 50));

//create a sql data adapter
SqlDataAdapter myDataAdapter = new SqlDataAdapter();
myDataAdapter.SelectCommand = mySelectCommand;

//assign the param to the sql params
myDataAdapter.SelectCommand.Parameters["@emailAddress"].Value =
this.TextBoxEmailaddr.Text.Trim();
myConn.Open();

// create a dataset
DataSet myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet);
myConn.Close()

2) how do i access a column field called : contactPassword in my Table

this.lblPassword.Text =
myDataSet.Tables["TABLE_Contact_Info"].Rows[0]["contactPassword"].ToString();

IT IS NOT working please help thx in advance


--

SevDer
http://www.sevder.com
Nov 18 '05 #2

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

Similar topics

1
by: Erwin Pant via DotNetMonster.com | last post by:
Hi, I'm uploading .dbf and MS Access tables into my DataSet (untyped) and I wanted to know what would be the best way to get the column lengths once the data has been placed in my DataSet. I am...
2
by: nabil m | last post by:
hi i have a couple of questions: 1) what is the difference between type and untyped dataset - i would like t ouse the typed dataset to take adv of intellisense- but the dataset i have created...
0
by: Tina | last post by:
I added an untyped dataset to my aspx page and named it dsDisplay (name and datasetname), defined a table and some columns all in the design time properties. The windows generated code has what...
2
by: thomson | last post by:
Hi All, What is the difference between a typed dataset and an untyped datset, Where can be this used actually, I mean in which situation which has to be used, In case anyone has got some...
7
by: Przemo | last post by:
Hi, I wonder about performerce comparision between these two types of DataSets. Are benefits of typed DataSets enought to beat speed of untyped ones? Or it doesn't matter? What do you think? ...
4
by: michael sorens | last post by:
I have successfully bound an XmlDocument to a DataGridView but all fields seem to be strings. I want to retrofit appropriate datatypes on some of the fields. Let me take this in 2 parts. Part...
4
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard......
0
by: vrushalik | last post by:
Hi, i want to know pros and cons of both Typed and Untyped dataset in detail. can we customize untyped dataset? What is benefit of Typed dataset? is there significant difference between...
4
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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.