473,765 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("SEL ECT ContactPassword
ContactUserID FROM TABLE WHERE (ContactUserID = @emailAddress)" );
mySelectCommand .Connection = myConn;

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

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

//assign the param to the sql params
myDataAdapter.S electCommand.Pa rameters["@emailAddr ess"].Value =
this.TextBoxEma iladdr.Text.Tri m();
myConn.Open();

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

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

this.lblPasswor d.Text =
myDataSet.Table s["TABLE_Contact_ Info"].Rows[0]["contactPasswor d"].ToString();

IT IS NOT working please help thx in advance
Nov 18 '05 #1
1 1741
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
SqlConnectio n myConn = new SqlConnection(" ");
SqlCommand mySelectCommand = new SqlCommand("SEL ECT ContactPassword
ContactUserI D FROM TABLE WHERE (ContactUserID = @emailAddress)" );
mySelectComman d.Connection = myConn;

// let it know about that paramter
mySelectComman d.Parameters.Ad d(new SqlParameter("@ emailAddress",
SqlDbType.VarC har, 50));

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

//assign the param to the sql params
myDataAdapter. SelectCommand.P arameters["@emailAddr ess"].Value =
this.TextBoxEm ailaddr.Text.Tr im();
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.lblPasswo rd.Text =
myDataSet.Tabl es["TABLE_Contact_ Info"].Rows[0]["contactPasswor d"].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
369
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 not using typed DataSets because theses tables come from clients and the layouts are always different. I've tried using the WriteSchemaMethod which creates my .XSD file, but the column lengths are not there. The only other solutions that I can...
2
2074
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 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...
0
876
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 appears to be the proper definitions... Protected WithEvents dsDisplay As System.Data.DataSet Me.dsDisplay = New System.Data.DataSet However, the the code module dsDisplay is undefined! Anyone know why?
2
5087
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 articles please let me know Thanks in Advance Regards
7
1800
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? Przemo
4
16739
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 I: I found the ValueType field, leading me to believe that I could say dataGridView.Columns.ValueType = typeof(Double); dataGridView.Columns.ValueType = typeof(Integer); etc.
4
9923
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... code gen, code gen, code gen. What's at the end looks slick, but then there's a ton of generated code that I'm going to have to maintain now. I.e. I like typing things myself (don't like wizards) so I can know exactly what I've done.
0
1332
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 performance of Typed and untyped dataset?
4
3112
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 comparisions) cleared? Thanks, Rachana
0
9393
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9946
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8830
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7371
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5272
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5413
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3921
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 we have to send another system
2
3530
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.