473,386 Members | 1,764 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,386 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 2218
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.