PC Review


Reply
Thread Tools Rate Thread

Control References in DataAdapter Commands

 
 
Christopher Weaver
Guest
Posts: n/a
 
      4th May 2005
How do I reference one of the properties of a form control within a SQL
Command of a DataAdapter? Do I have to do this dynamically within code or
can it be done within the CommandText property editor?


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      4th May 2005
Christopher,

From your text I assume that you use the designer. Using that you can use
the databinding tab of the control.

By instance with a textbox you bind the "Text" to a column of your
datatable.

You can use as well code of course.

http://msdn.microsoft.com/library/de...dingstopic.asp

I hope this helps,

Cor



 
Reply With Quote
 
Christopher Weaver
Guest
Posts: n/a
 
      4th May 2005
Thanks. Can you tell me how this would be done in code?


"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:OsO$(E-Mail Removed)...
> Christopher,
>
> From your text I assume that you use the designer. Using that you can use
> the databinding tab of the control.
>
> By instance with a textbox you bind the "Text" to a column of your
> datatable.
>
> You can use as well code of course.
>
> http://msdn.microsoft.com/library/de...dingstopic.asp
>
> I hope this helps,
>
> Cor
>
>
>



 
Reply With Quote
 
Christopher Weaver
Guest
Posts: n/a
 
      4th May 2005
Never Mind! I got it.

This works if you ignore the line breaks. (And, for those who don't
recognize it, I'm in dialect 3, hence all the quotes.)

string sCategory = cbCategoryLookUp.Text;
odbcDA_SubCategoryLookUp.SelectCommand.CommandText = "SELECT DISTINCT
\"SubCategory\" FROM \"tblSubCategory\" WHERE \"Category\" = '" + sCategory
+"'";


"Christopher Weaver" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks. Can you tell me how this would be done in code?
>
>
> "Cor Ligthert" <(E-Mail Removed)> wrote in message
> news:OsO$(E-Mail Removed)...
>> Christopher,
>>
>> From your text I assume that you use the designer. Using that you can
>> use the databinding tab of the control.
>>
>> By instance with a textbox you bind the "Text" to a column of your
>> datatable.
>>
>> You can use as well code of course.
>>
>> http://msdn.microsoft.com/library/de...dingstopic.asp
>>
>> I hope this helps,
>>
>> Cor
>>
>>
>>

>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      4th May 2005
Christopher,

Now I got what you mean.

For this are the odbcdataadapterParameters.
http://msdn.microsoft.com/library/de...ctortopic2.asp

This is the other side around.

I hope this helps,

Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataAdapter Commands Charles Microsoft ADO .NET 2 15th Feb 2006 08:36 AM
Parameters with DataAdapter commands Predrag Microsoft ADO .NET 1 17th Mar 2004 02:51 PM
run Insert/Delete DataAdapter commands? Rich Microsoft VB .NET 2 10th Feb 2004 06:59 PM
DataAdapter using commandbuilder's commands, not it's own. Marina Microsoft ADO .NET 1 12th Dec 2003 05:58 PM
DataAdapter using commandbuilder's commands, not it's own. Marina Microsoft ASP .NET 1 12th Dec 2003 04:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:50 AM.