473,320 Members | 1,845 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.

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 GetNewestVersionByProductID(ByVal x As String)

Dim objConn As New
OleDb.OleDbConnection(ConfigurationSettings.AppSet tings("strConnection"))
Dim strSQL As String = "SELECT tblProduct.Drawing,
tblProduct.SheetType, Max(tblProduct.ProductVersion) AS
MaxOfProductVersion, " & _
"Max(ProductRevision.Revision) AS MaxOfProductRevision,
tblProduct.SheetNumber FROM tblProducts " & _
"INNER JOIN (ADCN INNER JOIN Sheet ON ADCN.RecordID =
tblProduct.RecordID) " & _
"ON tblProduct.ProductID = tblRevisions.ProductID WHERE " & _
"tblProduct.ProductID = '" & x & "' AND tblProduct.SheetType = 'SH' " &
_
"GROUP BY tblProduct.ProductType, tblProduct.ProductID,
tblProduct.PageNumber;"

Dim ds As New DataSet
Dim objCommand As New OleDb.OleDbCommand(strSQL, objConn)
Dim myCommand As New OleDb.OleDbDataAdapter(strSQL, objConn)
myCommand.Fill(ds, "tblProducts")
ds.Tables("tblProducts").Columns.Add("ProductVersi onString")
Dim i As Integer = 0
Dim countSheetNumber As Integer = dsADCN.Tables("tblADCN").Rows.Count()

For i = 0 To countSheetNumber - 1
If ds.Tables("tblProducts").Rows(i)("MaxOfProductVers ion") Is Nothing
Then ds.Tables("tblProduct").Rows(i)("ProductVersionStr ing") = "0"
ds.Tables("tblProducts").Rows(0)("ProductVersionSt ring") +=
ds.Tables("tblProduct").Rows(0)("MaxOfProductVersi on") & i + 1
Next

Return ds.Tables("tblProducts").DefaultView

End Function

Nov 19 '05 #1
0 869

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

Similar topics

8
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...
3
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, ...
3
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...
7
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...
1
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...
5
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...
1
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...
3
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...
4
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;...
2
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...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: 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

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.