473,795 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling and use the StoredProcedure

Hello!

Is it possible to use a StoredProcedure when you have SqlDataAdapter or is
it
only possible when you have SqlCommand like
SqlCommand thisCommand = myConnection.Cr eateCommand;
thisCommand.Com mandType = CommandType.Sto redProcedure;
thisCommand.Com mandText = "MyStoredproced ure";

As far as I can see how would you tell SqlDataAdaper that you will use a
StoredProcedure ?

//Tony
Aug 27 '08 #1
1 1165
Hello Tony,

the dataAdapter's SelectCommand property must be assigned to a sqlCommand
object with the commandtype set to 'CommandType.St oredProcedure' as you did
in your sample.

(yourDataAdapte r.SelectCommand = yourSqlCommand)

Regards

Frank

-------------------------------
Frank Werner-Krippendorf
fr***@krippendo rf-online.ch
Hello!

Is it possible to use a StoredProcedure when you have SqlDataAdapter
or is
it
only possible when you have SqlCommand like
SqlCommand thisCommand = myConnection.Cr eateCommand;
thisCommand.Com mandType = CommandType.Sto redProcedure;
thisCommand.Com mandText = "MyStoredproced ure";
As far as I can see how would you tell SqlDataAdaper that you will use
a StoredProcedure ?

//Tony

Aug 27 '08 #2

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

Similar topics

1
983
by: Jon Cosby | last post by:
How do you call an existing procedure? My database has a procedure called "StudentSchedule" with one parameter, @StudentID. I'm trying to fill the results in a datagrid with a StoredProcedure command. The grid is not even showing on the page. SqlCommand cmdSchedule = new SqlCommand("StudentSchedule", this.cnBCC); cmdSchedule.CommandType = CommandType.StoredProcedure; SqlParameter studID = cmdSchedule.Parameters.Add("@StudentID",...
4
5575
by: Jeff | last post by:
Help!! I'm trying to convert a visual basic stand alone program into a Web Program using C#. There are a lot of Oracle packages already written that I am trying to use (unsuccessfully). Can someone point me in the right direction on how to call an Oracle package into a datagrid?? something like:
0
1966
by: JN | last post by:
Hello, I'm having problem calling stored procedures from Visual FoxPro database. I got the following exception error: "System.Data.OleDb.OleDbException: Unrecognized command verb" It seems like the stored procedures are not recognized by .Net.
1
1728
by: Eric Land | last post by:
Help! I'm trying to call a parameterized stored proc in ASP.NET in VB. I am creating a command object and creating a parametr list, and assigning a value from a session variable (this is working) so that I can sen in the value as a parameter. When I try to use the adapter's fill command to fill the data set, it get a error tellig me that I am not giving the stored procedure the parameter that it expects, even though I am! I've looked...
2
19473
by: Roger | last post by:
I put this in the microsoft.public.dotnet.langueages.vb.data newsgroup, but noticed there aren't alot of people there frequently like this newsgroup. So I thought I would try here. I get an error stating this call is to a function not a stored procedure? How do I call a stored function in SQL Server from vb.net Thanks....
4
1390
by: Peter Afonin | last post by:
Hello, I have a weirdest issue I've ever had. I have a function that enters some data into the Oracle table and returns the sequential row number for the new record (autonumber): Private Function AddSystem(ByVal txt As TextBox, ByVal cn As OracleConnection) As Integer Try
9
2207
by: Frank | last post by:
Hi, imagine there's a WEB application reading data from an Oracle database to visualize in using DataGrids in the clients browser. Yes, sounds simple, just create OracleConnection + OracleCommand + DataAdapter, bind a DataGrid to the DataAdapter, that's it. Problem with that approach might be the hardcoded CommandString of the OracleCommand. Whenever somebody requests query string changes you have to adapt the C# code, to recompile and...
4
17406
by: eighthman11 | last post by:
I'm calling a stored procedure on a sql server from an access application. I just need the stored procedure to run I do not need any data returned from the stored procedure to my Access application but I do pass parameters from my Access application. What I have works fine and is attached below. But I have one question. Why do I need this line of code to execute the stored procedure. Set rst = qdf.OpenRecordset(dbOpenSnapshot) Here...
0
1416
by: aravindalapat | last post by:
Hi All, I am facing an error when I try to invoke a remote nested stored proc. Please find the details below. 1) SP TEST1 is defined in DB2 instance DB2A. It is calling a stored procedure REMOTE1 which is defined in another instance DB2B. 2) Before actually calling REMOTE1, the calling stored procedure is connecting to DB2B instance using connect statement and the remote storedprocedure is called with the name...
0
9519
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
10437
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...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
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
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
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
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3723
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.