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

Control References in DataAdapter Commands

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?
Nov 17 '05 #1
4 1192
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

Nov 17 '05 #2
Thanks. Can you tell me how this would be done in code?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:Os**************@TK2MSFTNGP15.phx.gbl...
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

Nov 17 '05 #3
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" <we*****@verizon.net> wrote in message
news:eZ**************@TK2MSFTNGP15.phx.gbl...
Thanks. Can you tell me how this would be done in code?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:Os**************@TK2MSFTNGP15.phx.gbl...
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


Nov 17 '05 #4
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
Nov 17 '05 #5

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

Similar topics

5
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the...
16
by: Gary | last post by:
I have a form that takes one Contact record and edit's it. The routine used is as follows: Private Sub ContactMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
13
by: Doug Bell | last post by:
Hi, I thought I had this sorted this morning but it is still a problem. My application has a DataAccess Class. When it starts, it: Connects to a DB (OLE DB) If it connects it uses an...
3
by: RJN | last post by:
Hi I'm using the Dataadapter and Dataset to do an insert/update/delete into tables. The dataset has multiple tables in it. I want to write my own Update/Insert commands for the Dataadapter for...
6
by: cj | last post by:
I'm tryin to set up a sqlcommand in VB.NET that would issue the command: insert into server1.database.owner.table select * from server2.database.owner.table Since this sqlcommand has it's...
1
by: Franklin M. Gauer III | last post by:
I create a simple DATAADAPTER in a webservice project. It creates the UPDATE, INSERT, DELETE commands for me - no problem. In vS2005 it creates these commands as RESOURCES in the RESX file (i.e....
2
by: Franklin M. Gauer III | last post by:
I create a simple DATAADAPTER in a webservice project. It creates the UPDATE, INSERT, DELETE commands for me - no problem. In vS2005 it creates these commands as RESOURCES in the RESX file (i.e....
3
by: Rich | last post by:
What is the diffeence bewtween a dataAdapter.InsertCommand and dataAdapter.SelectCommand (and dataAdapter.UpdateCommand for that matter)? Dim da As SqlDataAdapter conn.Open da.SelectCommand =...
2
by: BobLewiston | last post by:
I can read in an SQL table ("Person.Contact") from AdventureWorks and step through it one row at a time, but when I try to save a record, either one I'm inserting or one I'm editting, I get the...
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: 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?
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
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...

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.