473,395 Members | 1,756 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.

Want to update @parameter in select

I have a dataadapter that has "where field_name = @parameter". I need to
replace the @parameter and then call fillschema and then fill. I've looked
too long in the help files and haven't been able to find the code.

Nov 16 '05 #1
2 2222
Found it. I was using ( instead of [. Darn I hate when I'm scanning the
code and I am reading the VB and not the C#.

sqlDataAdapter1.SelectCommand.Parameters["@tracking_cd"].Value = myKey;

"Mike" <md*****@nospambennettcompany.com> wrote in message
news:OC*************@tk2msftngp13.phx.gbl...
I have a dataadapter that has "where field_name = @parameter". I need to
replace the @parameter and then call fillschema and then fill. I've looked too long in the help files and haven't been able to find the code.

Nov 16 '05 #2
Hi Mike:

I'm not sure I understand the problem for sure but I'll take a stab. To set
the value of @parameter you need to reference it in the command's paramaters
collection (assuming it's been added, if not, you'll need to add it)

myCommand.Parameters.Add("@parameter", SqlDbType.Varchar, 50).Value =
"Whatever";

//I'm assuming this is SQL Server b/c the @ symbol, but the same logic holds
for other providers. Moreover, there are multiple constructors for adding
params, you don't necessarily need to use this one.

If it's already added, all you need to do is
myCommand.Parameters("@parameter").Value = "whatever";

If this isn't what you need, can you tell me a little more about the end
game and hopefully I can be of more help.

Cheers,

Bill
"Mike" <md*****@nospambennettcompany.com> wrote in message
news:OC*************@tk2msftngp13.phx.gbl...
I have a dataadapter that has "where field_name = @parameter". I need to
replace the @parameter and then call fillschema and then fill. I've looked too long in the help files and haven't been able to find the code.

Nov 16 '05 #3

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

Similar topics

0
by: nightmarch | last post by:
I want update one record ,but I can't ,why? code like following: ##------------------------------------------------- import win32com.client as wc def main(): conn =...
5
by: Reestit Mutton | last post by:
Hi, I'm currently learning the ropes with CSS, PHP, MYSQL, Javascript etc... by redesigning my website as a database driven site. Okay, so I'm skilled at perl, data manipulation and data...
2
by: Mike | last post by:
I have a dataadapter that has "where field_name = @parameter". I need to replace the @parameter and then call fillschema and then fill. I've looked too long in the help files and haven't been...
2
by: Kha Tran | last post by:
When using function update of objectdatasource, I can call a function with parameters like id, name... (properties of object). Can I pass a parameter as an full object? Ex: update(id, name,...
0
by: SimonZ | last post by:
I would like to define update parameter which value is selectedValue from combobox in detail view: <UpdateParameters> <asp:ControlParameter ControlID="DetailsViewComboBox" Name="FName"...
2
by: simon.wilkinson | last post by:
Hi, I am trying to update all Select boxes on a page dynamically using javascript, I simple want to change the selected item in each select box when a tick box is pressed on the page. Each...
5
by: Roger | last post by:
I am doing some mass update on DB2 8.2 FP10 (say 400 to 500 rows on a 5000 row table) with just one commit. So this is taking lot of exclusive row locks as expected. When I run a select on the...
0
by: drapp | last post by:
Hi all, Don't know if its possible or not, but according to documentation, it should. Here's the basics as I am learning, so bear with me. I have a class used as a object data source for...
2
rahulephp
by: rahulephp | last post by:
Mysql - How to use UPDATE with SELECT??? I have two tables: 1) products_category -cat_id -cat_name 2) related_category -rel_cat_id (exaclty same as...
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...
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
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,...
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
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...
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...

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.