473,399 Members | 4,177 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,399 software developers and data experts.

Stored Procedure Results

I have a stored procedure which is as follows:

Alter Procedure "uspConfig"

(
@FO int,
@Pull varchar(4)
)
As
DELETE FROM tblEEConfig
INSERT INTO tblEEConfig
SELECT FO, Pull, Config, StartSNRange FROM tblSerialNum WHERE FO = @FO
AND Pull = @Pull;

This proc will only return one record. I would like to display the
Config and StartSNRange in a text box on a .net form.

After trying the .executereader method, the .parameter.add method and a
few others this is the code I am trying in a button click event:

Dim dsResults As String
Dim dsStartResults As String
dsResults = daEEConfig.Fill(DsEEConfig1).ToString
dsStartResults = daEEConfigStart.Fill(DsEEConfigStart1).ToString
txtFileLoc.Text = txtFileLoc.Text & dsResults & "\" & dsStartResults

I feel that I am way off the mark with this, but as it is, I have
already spent too much time trying to get this accomplished. Any
suggestions, either for the proc or the .net code, would be greatly
appreciated! Thanks!

Nov 21 '05 #1
4 911
The main problem is you need to choose a methodology. If you're going to use
Adapter.Fill - then you don't need ExecuteReader and vice versa.

For parameters - do you have something like this

cmd.Parameters.Add("@FO", SqlDbType.Int);
cmd.Parameters.Add("@Pull", SqlDbType.Varchar, 50);

cmd.Parameters["@FO"].Value = Whatever;
cmd.Parameters["@Pull"].Value = whaateverelse;

As far as setting a DataSet's ToString() representation to a string - that
definitely isn't the way to go... it should probably be da.Fill(myDataSet,
"SomeTable");

dsResults = myDataSet.Tables["SomeTable"].Rows[0][ColumnIndex]...

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Kait" <mi*******@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I have a stored procedure which is as follows:

Alter Procedure "uspConfig"

(
@FO int,
@Pull varchar(4)
)
As
DELETE FROM tblEEConfig
INSERT INTO tblEEConfig
SELECT FO, Pull, Config, StartSNRange FROM tblSerialNum WHERE FO = @FO
AND Pull = @Pull;

This proc will only return one record. I would like to display the
Config and StartSNRange in a text box on a .net form.

After trying the .executereader method, the .parameter.add method and a
few others this is the code I am trying in a button click event:

Dim dsResults As String
Dim dsStartResults As String
dsResults = daEEConfig.Fill(DsEEConfig1).ToString
dsStartResults = daEEConfigStart.Fill(DsEEConfigStart1).ToString
txtFileLoc.Text = txtFileLoc.Text & dsResults & "\" & dsStartResults

I feel that I am way off the mark with this, but as it is, I have
already spent too much time trying to get this accomplished. Any
suggestions, either for the proc or the .net code, would be greatly
appreciated! Thanks!

Nov 21 '05 #2
Thanks for giving me some direction! I still have a few kinks to work
out, but I am a lot closer! I used the following code based on your
suggestion:

Dim dsResults As String
Dim dsStartResults As String

daEEConfig.Fill(DsEEConfig1, "tblEEConfig")
daEEConfigStart.Fill(DsEEConfigStart1, "tblEEConfig")

dsStartResults = DsEEConfigStart1.Tables(0).Rows(0).Item(0)
dsResults = DsEEConfig1.Tables(0).Rows(0).Item(0)
Thanks again!!

Nov 21 '05 #3
Your welcome - let me know if you get stuck though and I'll do what I can to
help you.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Kait" <mi*******@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Thanks for giving me some direction! I still have a few kinks to work
out, but I am a lot closer! I used the following code based on your
suggestion:

Dim dsResults As String
Dim dsStartResults As String

daEEConfig.Fill(DsEEConfig1, "tblEEConfig")
daEEConfigStart.Fill(DsEEConfigStart1, "tblEEConfig")

dsStartResults = DsEEConfigStart1.Tables(0).Rows(0).Item(0)
dsResults = DsEEConfig1.Tables(0).Rows(0).Item(0)
Thanks again!!

Nov 21 '05 #4
Your welcome - let me know if you get stuck though and I'll do what I can to
help you.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Kait" <mi*******@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Thanks for giving me some direction! I still have a few kinks to work
out, but I am a lot closer! I used the following code based on your
suggestion:

Dim dsResults As String
Dim dsStartResults As String

daEEConfig.Fill(DsEEConfig1, "tblEEConfig")
daEEConfigStart.Fill(DsEEConfigStart1, "tblEEConfig")

dsStartResults = DsEEConfigStart1.Tables(0).Rows(0).Item(0)
dsResults = DsEEConfig1.Tables(0).Rows(0).Item(0)
Thanks again!!

Nov 21 '05 #5

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

Similar topics

3
by: Jarrod Morrison | last post by:
Hi All I have a stored procedure with a temporary table that with two columns in it. The first column contains 3 digit numbers and the second column some descriptive data. I was wondering what...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
0
by: James Hokes | last post by:
Hi All, We're using the 1.1. Framework against SQL Server 2000, and are having a strange issue where we don't get errors back from the stored procedure, i.e. the exception never gets thrown. ...
4
by: John | last post by:
Hi everyone, I have a stored procedure which I use to query a table. The first part of the stored procedure uses a cursor to update a temp table whilst the second part of the query actually...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
2
by: Carl San | last post by:
I am using ADO.Net in VB.net application. .Net Framework 1.1. In a stored procedure I have multiple output parameters and multiple result sets. How to code for this in ADO.Net? I have used...
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...
28
by: mooreit | last post by:
The purpose for my questions is accessing these technologies from applications. I develop both applications and databases. Working with Microsoft C#.NET and Microsoft SQL Server 2000 Production and...
2
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
7
by: eholz1 | last post by:
Hello PHP group, Could someone help me out? I have PHP 5.2, Apache 2.0, and MySQL 5.0 running on Linux (Redhat Fedora Core 6). All that works fine. I would like to be able to "call" a stored...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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...
0
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...
0
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,...

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.