473,668 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1350
On Jul 11, 4:55 pm, "Steve" <S...@community .nospam.comwrot e:
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 vGetUserInforma tion where ID = @id

and the view is doing all of the work
"Alexey Smirnov" <al************ @gmail.comwrote in message
news:11******** **************@ k79g2000hse.goo glegroups.com.. .
On Jul 11, 4:55 pm, "Steve" <S...@community .nospam.comwrot e:
>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.comwrot e:
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 vGetUserInforma tion 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******** *************@w 3g2000hsg.googl egroups.com...
On Jul 11, 7:45 pm, "Steve" <S...@community .nospam.comwrot e:
>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 vGetUserInforma tion 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.comwrot e:
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(s tring userName)
{
DataSet ds = new DataSet();
ds = UserInformation .UserDetails(us erName);
return ds;
}
"Alexey Smirnov" <al************ @gmail.comwrote in message
news:11******** **************@ r34g2000hsd.goo glegroups.com.. .
On Jul 11, 8:20 pm, "Steve" <S...@community .nospam.comwrot e:
>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.comwrot e:
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.goo glegroups.com.. .
On Jul 11, 8:58 pm, "Steve" <S...@community .nospam.comwrot e:
>i have something like

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

foreach(Stri ng 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.comwrot e:
I'm reading through it to see if the users in the textbox are in the
returned dataset from my stored procedure"Alexe y 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 vGetUserInforma tion table, then you
should get some data from it

select * from vGetUserInforma tion 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

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

Similar topics

1
3536
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 trying to use OLEDB through ADO to search results and serve them up onto an ASP.Net web page, yet I consistently get back 0 results. I have this working fine in a console application. I think my problem is I have to allow IIS access to my IS...
4
2200
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 to show the number of results found. Is there an easy way to add this to the top of the datagrid, along with the total number of pages ie: 67 resuts found page 1 of 7 (where the numbers in are hyperlinks to that
2
2015
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 using a dataview with no luck. Stored procedure: ALTER Proc spFillSbjRply ( @key int
2
2366
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? Store procedure below:- ------------------------
4
1632
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 '**************************************** sResults = "CustomerID" + vbTab + "ContactName" + vbTab +
3
3114
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 them, how do I go about doing that ? This is a search query, so I do not want to create another temp table to do this, any idea's please. Imran.
0
1270
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 believe the difference in speed! However, the asynch operation fails sometimes, despite of the fact that it works most of the time. I am really at a loss how to fix this sporadic and erratic behavior. This is a web application developed with...
2
3113
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, dataset.writexml works great (got the code from http://forums.devx.com/archive/index.php/t-57273.html ) The only question I have is, when Excel opens up, it isn't the view I would prefer. It opens as a read-only workbook, I would prefer as an
1
4453
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 = DatabaseControl.Database.GetConnection(Globals.dbConn); SqlCommand cmdTitles = new SqlCommand(); cmdTitles.CommandText = "SelectTitlesByCategory";
3
2834
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 dataset to data in a second dataset, using a common key. I will first describe the problem in words and then I will show my code, which has most of the solution done already. I have built an ASP.NET that queries an Index Server and returns a...
0
8890
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8791
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
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7398
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
6206
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
4202
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
4376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
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.