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

regarding datasets

Hi..i am new to this forum..i have a doubt regarding datasets..

i have a query say..

str=select name from student where rollno=1
and i have populated the result of this query into a dataset by
sqladapter.fill(ds) //where ds is the dataset..

if rollno is a primary key thn there will be only one name corresp to it..

can i read that name into a string variable..
can i read the value from the dataset into a variable and how??

is there a fn?? any recommended link will also be useful..
Aug 28 '06 #1
4 1203
Ok,Frnd

first to store a query in string variable
after then
to read that string into sqldataadapter witn conn string
bind that dataset into any datagrid controls.
Aug 29 '06 #2
Hi..i am new to this forum..i have a doubt regarding datasets..

i have a query say..

str=select name from student where rollno=1
and i have populated the result of this query into a dataset by
sqladapter.fill(ds) //where ds is the dataset..

if rollno is a primary key thn there will be only one name corresp to it..

can i read that name into a string variable..
can i read the value from the dataset into a variable and how??

is there a fn?? any recommended link will also be useful..



hi Supreet

i hope my answer would benefit u

dim strName as string
strName = ds.Tables(0).Rows(0).Item("name")
Aug 30 '06 #3
nmsreddi
366 256MB
hi

i didnt get ur problem correctly but u can read data from dataset in to any format depending on the requirement .to which control actually u r going to bind the data .
Aug 31 '06 #4
Buddy..i didnt get ur Qn tht perfectly ,but if inserting the name corresponding tht rollno=1 is wat u wanted..just try da below code..might help..


Dim ds as new dataset
Dim da as new sql dataadapter("select name from tablename where rollno="textbox1.text"",sqlcon) // here i assumed tht 'textbox1' is ur control where ur gng to enter a rollno.//
da.fill(ds,"tablename")
str=ds.tables("tablename").rows(row position).item(column position)
msgbox(str)



Result: in msgbx u'll get da name corresponding to the rollno.

bro..if this is not wat u wanted then just lemme know..
Aug 31 '06 #5

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

Similar topics

2
by: Rune Lanton | last post by:
Hello! I am developing an application for PPC2003, and I want too put my SQL CE db on a flash card. But I'm a little concerned about flash lifetime! Most flash memory have a limit of 100.000...
5
by: Ryan Ternier | last post by:
I know how this should be done in regards to nTier, but it seems a bit inneficient, and was wondering if there's a solution that I havn't thought of yet. (I'm switching this loop to For Each Row...
2
by: Rune Lanton | last post by:
Hello! I am developing an application for PPC2003, and I want too put my SQL CE db on a flash card. But I'm a little concerned about flash lifetime! Most flash memory have a limit of 100.000...
0
by: sanamashokreddy | last post by:
Hi i have some problem with my datasets the design has been changed and when iam addinf another dataset iam getting an Error. Error is:unable to cast com objects of type 'system._ComObject' to...
1
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: 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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.