474,042 Members | 43,000 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem Returning a Dataset

The function below works in that it returns the correct data back to
the dataset for 2 of the rows in my datalist:

A1 - A - 1
A1 - A - 2
A1 - A - 3
A1 - B - 1
A1 - B - 2
A1 - C - 1
A1 - C - 2
A1 - C - 3

The above dataset is returned as A1 - C - 3

What I would like to do is return A1 - C - C1, C2, C3

I have done a response.write( rowCount) and the correct number of rows
are returned. My main question is how do I go about creating the
string on each row in the dataset? Right now the first row looks like
A1, A2, A3, A4, A5, A6, A7, A8. This is partially correct because there
are 8 rows being returned. How do I configure my FOR NEXT to take it
row by row?

Function GetNewestVersio nByProductID(By Val x As String)

Dim objConn As New
OleDb.OleDbConn ection(Configur ationSettings.A ppSettings("str Connection"))
Dim strSQL As String = "SELECT tblProduct.Draw ing,
tblProduct.Shee tType, Max(tblProduct. ProductVersion) AS
MaxOfProductVer sion, " & _
"Max(ProductRev ision.Revision) AS MaxOfProductRev ision,
tblProduct.Shee tNumber FROM tblProducts " & _
"INNER JOIN (ADCN INNER JOIN Sheet ON ADCN.RecordID =
tblProduct.Reco rdID) " & _
"ON tblProduct.Prod uctID = tblRevisions.Pr oductID WHERE " & _
"tblProduct.Pro ductID = '" & x & "' AND tblProduct.Shee tType = 'SH' " &
_
"GROUP BY tblProduct.Prod uctType, tblProduct.Prod uctID,
tblProduct.Page Number;"

Dim ds As New DataSet
Dim objCommand As New OleDb.OleDbComm and(strSQL, objConn)
Dim myCommand As New OleDb.OleDbData Adapter(strSQL, objConn)
myCommand.Fill( ds, "tblProduct s")
ds.Tables("tblP roducts").Colum ns.Add("Product VersionString")
Dim i As Integer = 0
Dim countSheetNumbe r As Integer = dsADCN.Tables(" tblADCN").Rows. Count()

For i = 0 To countSheetNumbe r - 1
If ds.Tables("tblP roducts").Rows( i)("MaxOfProduc tVersion") Is Nothing
Then ds.Tables("tblP roduct").Rows(i )("ProductVersi onString") = "0"
ds.Tables("tblP roducts").Rows( 0)("ProductVers ionString") +=
ds.Tables("tblP roduct").Rows(0 )("MaxOfProduct Version") & i + 1
Next

Return ds.Tables("tblP roducts").Defau ltView

End Function

Nov 19 '05 #1
0 908

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

Similar topics

8
749
by: Bruce Stockwell | last post by:
the setup: Webservice/WinClient application/SQL server. VS.Net (visual basic) winform wizard creates a simple form with load cancel cancelall and datagrid bound to a simple Dataset with one Datatable. No coding by programer, All wizardry. User starts app, opens form, adds (4) records and clicks update.
3
51757
by: Mike P | last post by:
Is it possible to return a dataset from a stored procedure, or would you need to write the SQL in your .cs file to return the dataset? Any assistance would be really appreciated. Cheers, Mike
3
1324
by: R.A. | last post by:
Hi I have a web method that returns a string (which has an xml format). I get a dataset and I need to convert the table in the dataset to xml and then to send it as a string to the client. How can I do this? Thanks
7
2251
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL tabel. I know the SP works, because a smalldatetime-field in the database is changed. I've tried to disable viewstate on all textbox controls. Any ideas to solve this problem.
1
2924
by: John Young | last post by:
Hi, I have a strange problem with returning a dataset from a webservice. Here's some code... The error I get at compile time is. "Cannot convert type 'void' to 'System.Data.DataSet'" Can anyone help me please. I have heard something about typed datasets, would that make a difference? Thanks in advance...
5
19622
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was having a problem in the calling program. I searched online and found suggestions that I return an Array instead so I modified my code (below) to return an Array instead of an ArrayList. Now I get the message when I try to run just my webservice...
1
5568
by: J. Askey | last post by:
I am implementing a web service and thought it may be a good idea to return a more complex class (which I have called 'ServiceResponse') in order to wrap the original return value along with two other properties... bool error; string lastError; My whole class looks like this... using System;
3
2982
by: Khurram | last post by:
Hi, Firstly, I will apologise now if I have posted in the wrong discussion group. Please let me know if I have for future reference. Below is the code to a WebMethod that is querying an Access 2003 database, saving the results as a dataset and returning the dataset. public DataSet findAAPAssessment(string assessmentID) {
4
4939
by: Brad Baker | last post by:
I'm going a little crazy :) I'm trying to bind a repeater control to a dataset on page load using the following code: if (Request.QueryString != null) { string customerid = Request.QueryString; //open connection SqlConnection m_conn = new SqlConnection("Server=server; Database=database; UId=username; Pwd=password");
2
1373
by: Andy B | last post by:
I need to make a class and not quite sure how to go about doing this part. I want the class to take user input, build a dataset based on that input and then return it from the class so it can be used elsewhere. A few things about the dataset and the class that builds the dataset: 1. The dataset should already have prebuilt tables and columns that need to be filled in like Header, Sections, Glossary, FormHeader, Contacts and FormFooter....
0
10536
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10336
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
11599
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...
0
10304
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
8689
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
6648
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
6827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3964
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.