473,327 Members | 2,112 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,327 software developers and data experts.

add results to dataset

Ok, I hit a wall and I'm stuck. I have a web form that has a textbox were
the user can enter in 1 to many usernames, then the user has to validate the
user to make sure the user exists. I have a stored procedure that can only
take one username at a time, so I need to keep calling this stored procedure
with all of the usernames in the textbox( i have this portion working). The
issue I'm running into is that only the data for the last username passed to
the stored procedure is being passed back so if I enter in

JSmith, SLong, SHenry,

I'm only getting the details for SHenry, though I need to store and use the
details for all 3 users so I can add them to the user table.

so when I click the add buttong, its storing:
JSmith, SLong, SHenry in the user column of the table BUT storing SHenry,
phone number, email address etc. I need a row for each user with their own
information
So I either need somehow to keep adding it to the existing dataset or
somethign.

any suggestions on how to do this?

Jul 11 '07 #1
10 1332
On Jul 11, 4:55 pm, "Steve" <S...@community.nospam.comwrote:
Ok, I hit a wall and I'm stuck. I have a web form that has a textbox were
the user can enter in 1 to many usernames, then the user has to validate the
user to make sure the user exists. I have a stored procedure that can only
take one username at a time, so I need to keep calling this stored procedure
with all of the usernames in the textbox( i have this portion working). The
issue I'm running into is that only the data for the last username passed to
the stored procedure is being passed back so if I enter in

JSmith, SLong, SHenry,

I'm only getting the details for SHenry, though I need to store and use the
details for all 3 users so I can add them to the user table.

so when I click the add buttong, its storing:
JSmith, SLong, SHenry in the user column of the table BUT storing SHenry,
phone number, email address etc. I need a row for each user with their own
information

So I either need somehow to keep adding it to the existing dataset or
somethign.

any suggestions on how to do this?
Can we see the code of the stored procedure?

Jul 11 '07 #2
the stored procedure is actually a select statement that calls a view which
is doing a select, joins, etc on tables.
but the stored procedure is

select * from vGetUserInformation where ID = @id

and the view is doing all of the work
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
On Jul 11, 4:55 pm, "Steve" <S...@community.nospam.comwrote:
>Ok, I hit a wall and I'm stuck. I have a web form that has a textbox were
the user can enter in 1 to many usernames, then the user has to validate
the
user to make sure the user exists. I have a stored procedure that can
only
take one username at a time, so I need to keep calling this stored
procedure
with all of the usernames in the textbox( i have this portion working).
The
issue I'm running into is that only the data for the last username passed
to
the stored procedure is being passed back so if I enter in

JSmith, SLong, SHenry,

I'm only getting the details for SHenry, though I need to store and use
the
details for all 3 users so I can add them to the user table.

so when I click the add buttong, its storing:
JSmith, SLong, SHenry in the user column of the table BUT storing SHenry,
phone number, email address etc. I need a row for each user with their
own
information

So I either need somehow to keep adding it to the existing dataset or
somethign.

any suggestions on how to do this?

Can we see the code of the stored procedure?

Jul 11 '07 #3
On Jul 11, 7:45 pm, "Steve" <S...@community.nospam.comwrote:
the stored procedure is actually a select statement that calls a view which
is doing a select, joins, etc on tables.
but the stored procedure is

select * from vGetUserInformation where ID = @id

and the view is doing all of the work
Well, then it's something the code I guess... Need to see it :-)

Jul 11 '07 #4
need to see what? the .net code or the SQL code?

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11*********************@w3g2000hsg.googlegrou ps.com...
On Jul 11, 7:45 pm, "Steve" <S...@community.nospam.comwrote:
>the stored procedure is actually a select statement that calls a view
which
is doing a select, joins, etc on tables.
but the stored procedure is

select * from vGetUserInformation where ID = @id

and the view is doing all of the work

Well, then it's something the code I guess... Need to see it :-)

Jul 11 '07 #5
On Jul 11, 8:20 pm, "Steve" <S...@community.nospam.comwrote:
need to see what? the .net code or the SQL code?
Steve, you said that
issue I'm running into is that only the data for the last username passed to
the stored procedure is being passed back
So I think that the problem is somewhere either in the .net code which
runs the stored procedure, or in the stored procedure itself. If you
think that the stored procedure is ok then we should check the code
which calls the stored procedure. Maybe you call it only once, or
something like this... ??

Jul 11 '07 #6
i have something like

string userList = txtUsername.txt;
string[] user= userList.split(',');

foreach(String u in users)
{
DataSet dsUsers = new DataSet();
dsUsers = GetUserDetails(u);
}

//this calls the datalayer which houses the stored procedure
Public DataSet GetUserDetals(string userName)
{
DataSet ds = new DataSet();
ds = UserInformation.UserDetails(userName);
return ds;
}
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@r34g2000hsd.googlegr oups.com...
On Jul 11, 8:20 pm, "Steve" <S...@community.nospam.comwrote:
>need to see what? the .net code or the SQL code?

Steve, you said that
>issue I'm running into is that only the data for the last username passed
to
the stored procedure is being passed back

So I think that the problem is somewhere either in the .net code which
runs the stored procedure, or in the stored procedure itself. If you
think that the stored procedure is ok then we should check the code
which calls the stored procedure. Maybe you call it only once, or
something like this... ??

Jul 11 '07 #7
On Jul 11, 8:58 pm, "Steve" <S...@community.nospam.comwrote:
i have something like

string userList = txtUsername.txt;
string[] user= userList.split(',');

foreach(String u in users)
{
DataSet dsUsers = new DataSet();
dsUsers = GetUserDetails(u);

}
What do you do with dsUsers after that?

Jul 11 '07 #8
I'm reading through it to see if the users in the textbox are in the
returned dataset from my stored procedure
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@r34g2000hsd.googlegr oups.com...
On Jul 11, 8:58 pm, "Steve" <S...@community.nospam.comwrote:
>i have something like

string userList = txtUsername.txt;
string[] user= userList.split(',');

foreach(String u in users)
{
DataSet dsUsers = new DataSet();
dsUsers = GetUserDetails(u);

}

What do you do with dsUsers after that?

Jul 11 '07 #9
On Jul 11, 9:34 pm, "Steve" <S...@community.nospam.comwrote:
I'm reading through it to see if the users in the textbox are in the
returned dataset from my stored procedure"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message
Okay, let's test it...

You have JSmith, SLong, SHenry in the txtUsername

So

string userList = txtUsername.txt;
string[] user= userList.split(',');

foreach(String u in users)
{
// user #1: JSmith

DataSet dsUsers = new DataSet();
dsUsers = GetUserDetails(u); // u = JSmith

// and now, what do you do with the data?
}

If database has that JSmith in the vGetUserInformation table, then you
should get some data from it

select * from vGetUserInformation where ID = @id // @id = 'JSmith'

if dsUsers is not empty than the error somewhere in the .net code
after the one you sent above.

Jul 11 '07 #10
On Jul 11, 10:29 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Jul 11, 9:34 pm, "Steve" <S...@community.nospam.comwrote:
I'm reading through it to see if the users in the textbox are in the
returned dataset from my stored procedure"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message
P.S.

string[] user= userList.split(',');

returns

'JSmith'
' SLong' <-- with the leading space
' SHenry' <-- with the leading space

could be a problem, if you don't trim()

Jul 11 '07 #11

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

Similar topics

1
by: Don | last post by:
I am new to Indexing Services, have been researching the MS Site as well as web articles on DevHood, etc. I have set up a seperate catalog ("KnowledgeBase") on Win XP with a number of files. I am...
4
by: Tim T | last post by:
Hi, I have a stored procedure executing a search and an asp.net page displaying the results in a datagrid. The datagrid has paging on it, I am using Visual Studio.NET and can't see any option...
2
by: Sandy | last post by:
Hello - I have the following stored procedure and code. I want to put the results in two textboxes. I get to the part where I create the dataset and then I don't know what to do. I tried...
2
by: Patrick Olurotimi Ige | last post by:
When i run the code below with stored proc :- I get only the first table results :-"templates" even if i fill the dataset with another table for example category,pages etc.. Any ideas? ...
4
by: jaYPee | last post by:
I have downloaded some source code but I want this to convert the results into datagrid. dr = cmd.ExecuteReader() '**************************************** ' SHOW THE RESULTS...
3
by: Imran Aziz | last post by:
Hello All, I have a dataset that I populate using a SQL Server database, and the second one that I populate using a mySQL Server database, I need to combine the results in memory and then sort...
0
by: r1 | last post by:
I am relatively inexperienced in using delegates and asynchronous methods. I read several articles, and then I developed my own code with a mission to improve the performance. Wow! I cannot...
2
by: Mad Scientist Jr | last post by:
>From an asp.net web page I want the user to open the results of a SQL query in Excel, as automatically as possible (ie not having to loop through columns, rows, in code). For this,...
1
by: JustinCarmony | last post by:
I'm using a DataAdapter to fill a DataSet to display a list of items in a custom way. I'm not using the GridView or any server controls like that. This is my code: <code> SqlConnection sqlConn...
3
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one...
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...
0
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.