473,395 Members | 1,335 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,395 software developers and data experts.

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 \"tblSubCategory\" SET \"SubCategory\" = ? "
+ "WHERE \"Category\" = ?; "
+ "UPDATE \"tblCategory\" SET \"Category\" =
? "
+ "WHERE \"Category\" = ?";
cmd.Parameters.Add(new System.Data.Odbc.OdbcParameter("SubCategory",
System.Data.Odbc.OdbcType.NVarChar, 50, "SubCategory"));
cmd.Parameters.Add(new System.Data.Odbc.OdbcParameter("Category",
System.Data.Odbc.OdbcType.NVarChar, 50, "Category"));
cmd.Parameters.Add(new System.Data.Odbc.OdbcParameter("NewCategory",
System.Data.Odbc.OdbcType.NVarChar, 50, "Category"));
cmd.Parameters.Add(new System.Data.Odbc.OdbcParameter("OldCategory",
System.Data.Odbc.OdbcType.NVarChar, 50, ParameterDirection.Output, false, 0,
0, "Category", DataRowVersion.Current,
dsCatSubCats.Tables["Categories"].Columns["Category"] ));
Nov 17 '05 #1
2 3153
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.Direction = ParameterDirection.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**********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.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.Direction = ParameterDirection.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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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...
0
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,...

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.