473,809 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

new OdbcParameter("

I'm more than a little bit confused by the last parameter of one of the
overloads of this constructor. I'm pretty certain that I need to specify
that the parameter is an output and what the source column is, and so I'm
constrained to this overload. I just don't know what the last parameter is
for.

I'm creating the update SQL, shown below. I've included a reference to an
object in the tenth parameter, as required by the constructors parameter
list, but it seems to be redundant in light of the ninth parameter, which is
said to be the name of the source column. If anyone could shed some light
on this for me I would be very grateful.

Also, is there another way to go about this that would not involve using
this particular overload of the OdbcParameter constructor?

cmd.CommandText = "@UPDATE \"tblSubCategor y\" SET \"SubCategor y\" = ? "
+ "WHERE \"Category\" = ?; "
+ "UPDATE \"tblCategor y\" SET \"Category\" =
? "
+ "WHERE \"Category\" = ?";
cmd.Parameters. Add(new System.Data.Odb c.OdbcParameter ("SubCategor y",
System.Data.Odb c.OdbcType.NVar Char, 50, "SubCategory")) ;
cmd.Parameters. Add(new System.Data.Odb c.OdbcParameter ("Category",
System.Data.Odb c.OdbcType.NVar Char, 50, "Category") );
cmd.Parameters. Add(new System.Data.Odb c.OdbcParameter ("NewCategor y",
System.Data.Odb c.OdbcType.NVar Char, 50, "Category") );
cmd.Parameters. Add(new System.Data.Odb c.OdbcParameter ("OldCategor y",
System.Data.Odb c.OdbcType.NVar Char, 50, ParameterDirect ion.Output, false, 0,
0, "Category", DataRowVersion. Current,
dsCatSubCats.Ta bles["Categories "].Columns["Category"] ));
Nov 17 '05 #1
2 3176
As far as i see, the tenth parameter is the value of the Odbc Parameter
whereas the ninth parameter is the name of the parameter. Since the
category parameter is an output parameter in your case, you pass it as
null.

There is another way of doing this without using this constructor.

OdbcParameter category = new OdbcParameter() ;
category.Direct ion = ParameterDirect ion.Output;
.... this way you can set all properties that you want.

Not sure if this is what you want.

Regards,
Arun Prakash. B

Nov 17 '05 #2
This may be exactly what I needed to know. I'm especially intrigued by the
option of setting the properties after the object is created. Can't believe
I didn't think of that!
<ar**********@g mail.com> wrote in message
news:11******** *************@g 43g2000cwa.goog legroups.com...
As far as i see, the tenth parameter is the value of the Odbc Parameter
whereas the ninth parameter is the name of the parameter. Since the
category parameter is an output parameter in your case, you pass it as
null.

There is another way of doing this without using this constructor.

OdbcParameter category = new OdbcParameter() ;
category.Direct ion = ParameterDirect ion.Output;
... this way you can set all properties that you want.

Not sure if this is what you want.

Regards,
Arun Prakash. B

Nov 17 '05 #3

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

Similar topics

0
2277
by: John D. | last post by:
I am having problems inserting Decimal values into a DB2 database via a .NET/C# application which is using an OdbcDataAdapter. Other field types such as VarChar, Int, Date, etc work ok, and I can insert literal values into a decimal field, but any attempt to insert a decimal field via an OdbcParameter causes a System.InvalidOperationException ("The connection is dead") to be thrown by the DbDataAdapter.Update method. The ODBC driver is...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10376
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...
1
10383
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
10120
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...
1
7661
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
6881
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
5550
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...
1
4332
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
3861
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.