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

retrieve a record from a dataset?????

How can I retrieve display_names

Dim custDS As DataSet = New DataSet

Dim mySQL, mySQL2, mySQL3 As String

mySQL = "SELECT id,GBL_NO,TCN,TRAC_NO,SHIP_NAME, CAT FROM(SELECT
id,GBL_NO,TCN,TRAC_NO,CAT,SHIP_NAME, ROW_NUMBER() OVER ( PARTITION BY TCN
ORDER BY TCN, TRAC_NO, CAT ) as row_num FROM TRACK.DTTS WHERE (CDATE BETWEEN
TO_DATE('7/18/2003','MM/DD/YYYY') AND TO_DATE('7/20/2004','MM/DD/YYYY')) AND
((gbl_no= qqqqqqqqqq)) ) WHERE row_num = 1 ORDER BY TCN"

' mySQL = "SELECT id,GBL_NO,TCN,TRAC_NO, CAT FROM(SELECT
id,GBL_NO,TCN,TRAC_NO,CAT, ROW_NUMBER() OVER ( PARTITION BY GBL_NO ORDER BY
GBL_NO, TCN, TRAC_NO, CAT ) as row_num FROM TRACK.V_LATESTPNTDTTS WHERE
(CDATE BETWEEN TO_DATE('7/18/2003','MM/DD/YYYY') AND
TO_DATE('7/20/2004','MM/DD/YYYY')) AND ((SCACNAME LIKE 'T%')) or ((SCACNAME
LIKE 'p%'))) WHERE row_num = 1 ORDER BY GBL_NO"

mySQL2 = "SELECT TCN,CDATE FROM TRACK.DTTS WHERE (CDATE BETWEEN
TO_DATE('7/18/2003','MM/DD/YYYY') AND TO_DATE('7/20/2004','MM/DD/YYYY')) AND
((gbl_no= 'A-1003601-01')) ORDER BY tcn,id"

mySQL3 = "SELECT display_names FROM TRACK.V_RPTTRACK WHERE ID = 6"

Dim myTable As DataTable

myTable = myData.GetTableData(mySQL)

custDS.Tables.Add(myTable)

custDS.Tables(0).TableName = "Table1"

myTable = myData.GetTableData(mySQL2)

custDS.Tables.Add(myTable)

custDS.Tables(1).TableName = "Table2"

myTable = myData.GetTableData(mySQL3)

custDS.Tables.Add(myTable)

custDS.Tables(2).TableName = "Table3"

************************************************** *** How can I retrieve
display_names ******************************

'custDS = myData.GetData(mySQL)

'custDS1 = myData.GetData(mySQL2)

custDS.Relations.Add("table2", custDS.Tables("Table1").Columns("TCN"),
custDS.Tables("Table2").Columns("TCN"), False)

custDS.Relations("Table2").Nested = True

custDS.WriteXml(Server.MapPath("Relate.xml"), XmlWriteMode.WriteSchema)

If (custDS.Relations.Count < 1) Then
custDS.Relations.Add(custDS.Tables("Table1").Colum ns("TCN"),
custDS.Tables("Table2").Columns("TCN"))

Me.grdtest.DataSource = custDS ' = custDS.Tables("Table1").DefaultView

'grdtest.

grdtest.Visible = True

Me.DataBind()
--
David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
da***@helixpoint.com
Nov 18 '05 #1
1 1502
the dataset can be addressed like a matrix
ds.tables[0].rows[row][col].tostring() so you can use row,col co-ordinates
to find your item

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"DaveF" <df*****@geodecisions.com> wrote in message
news:O5**************@tk2msftngp13.phx.gbl...
How can I retrieve display_names

Dim custDS As DataSet = New DataSet

Dim mySQL, mySQL2, mySQL3 As String

mySQL = "SELECT id,GBL_NO,TCN,TRAC_NO,SHIP_NAME, CAT FROM(SELECT
id,GBL_NO,TCN,TRAC_NO,CAT,SHIP_NAME, ROW_NUMBER() OVER ( PARTITION BY TCN
ORDER BY TCN, TRAC_NO, CAT ) as row_num FROM TRACK.DTTS WHERE (CDATE
BETWEEN
TO_DATE('7/18/2003','MM/DD/YYYY') AND TO_DATE('7/20/2004','MM/DD/YYYY'))
AND
((gbl_no= qqqqqqqqqq)) ) WHERE row_num = 1 ORDER BY TCN"

' mySQL = "SELECT id,GBL_NO,TCN,TRAC_NO, CAT FROM(SELECT
id,GBL_NO,TCN,TRAC_NO,CAT, ROW_NUMBER() OVER ( PARTITION BY GBL_NO ORDER
BY
GBL_NO, TCN, TRAC_NO, CAT ) as row_num FROM TRACK.V_LATESTPNTDTTS WHERE
(CDATE BETWEEN TO_DATE('7/18/2003','MM/DD/YYYY') AND
TO_DATE('7/20/2004','MM/DD/YYYY')) AND ((SCACNAME LIKE 'T%')) or
((SCACNAME
LIKE 'p%'))) WHERE row_num = 1 ORDER BY GBL_NO"

mySQL2 = "SELECT TCN,CDATE FROM TRACK.DTTS WHERE (CDATE BETWEEN
TO_DATE('7/18/2003','MM/DD/YYYY') AND TO_DATE('7/20/2004','MM/DD/YYYY'))
AND
((gbl_no= 'A-1003601-01')) ORDER BY tcn,id"

mySQL3 = "SELECT display_names FROM TRACK.V_RPTTRACK WHERE ID = 6"

Dim myTable As DataTable

myTable = myData.GetTableData(mySQL)

custDS.Tables.Add(myTable)

custDS.Tables(0).TableName = "Table1"

myTable = myData.GetTableData(mySQL2)

custDS.Tables.Add(myTable)

custDS.Tables(1).TableName = "Table2"

myTable = myData.GetTableData(mySQL3)

custDS.Tables.Add(myTable)

custDS.Tables(2).TableName = "Table3"

************************************************** *** How can I retrieve
display_names ******************************

'custDS = myData.GetData(mySQL)

'custDS1 = myData.GetData(mySQL2)

custDS.Relations.Add("table2", custDS.Tables("Table1").Columns("TCN"),
custDS.Tables("Table2").Columns("TCN"), False)

custDS.Relations("Table2").Nested = True

custDS.WriteXml(Server.MapPath("Relate.xml"), XmlWriteMode.WriteSchema)

If (custDS.Relations.Count < 1) Then
custDS.Relations.Add(custDS.Tables("Table1").Colum ns("TCN"),
custDS.Tables("Table2").Columns("TCN"))

Me.grdtest.DataSource = custDS ' = custDS.Tables("Table1").DefaultView

'grdtest.

grdtest.Visible = True

Me.DataBind()
--
David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
da***@helixpoint.com

Nov 18 '05 #2

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

Similar topics

0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
4
by: Claudia Fong | last post by:
Hi, I have a form where I need to display the data of a department that stores in a access db. When I first load the form it will call a function name loaddata which will get the first...
5
by: Roy Gourgi | last post by:
Hi, I am used to working in Visual FoxPro and I would like to be able to create a database and store and retrieve information from it. What is the simplest way to do it and what should I be...
4
by: jay | last post by:
I am using the dataset object to add a row to a sql server database in vb.net code, as follows: dim drow as DataRow dim cmdBld as new SqlCommandBuilder(mySqlDataAdapter) ds.tables(0).NewRow()...
6
by: enrique | last post by:
Hello, I simpy want to place a record ID into a session variable. I know how to create session variables, I'm just can't figure out the syntax for the record item when I'm working with a...
12
by: jaYPee | last post by:
I have currently using a dataset to access my data from sql server 2000. The dataset contains 3 tables that is related to each other. parent/child/grandchild relationship. My problem is it's very...
13
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end...
1
by: prajin | last post by:
i have to retrieve hidden data from gridview. hidden data is Usr_No. then i need to update the record based on that condition. now i am getting the hidden data. but only first record is...
3
by: cathy25 | last post by:
Hi all, My requirement is to allow users to enter partno. in a text box. There is a button called 'populate'. whenever the user enters a partno. and hits on populate button, the matching record...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.