473,387 Members | 1,573 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.

Typed Dataset and Table Adaptor

Hi -

I'm working in VS2008, C.

I created a New Data Source via wizard and added a customized Select Query
to the TableAdapter.

It's simple:
Select ID, Name From myTable
Where ID = @id

So in code I excute the Fill method:
this.myTableTableAdapter.FillbyID(this.myDataSet.m yTable, 14);

Where/How at runtime can I see the Select statement after the parameter has
been resolved? It would look like this:
Select ID, Name From myTable
Where ID = 14

Thank you,
Mark

Jun 27 '08 #1
1 1163
So in code I excute the Fill method:
this.myTableTableAdapter.FillbyID(this.myDataSet.m yTable, 14);

Where/How at runtime can I see the Select statement after the parameter has
been resolved? It would look like this:
Select ID, Name From myTable
Where ID = 14
In short, you can't.

You are (properly) using a parametrized query. However, you seem to
misunderstand how they work. The whole point behind a parametrized
query is that the parameter is *not* just stuffed into the SQL string.
The parameters are bundled separate from the query. The TableAdapter
abstracts most of this out or your view, though it might be
informative to dig into the generated code.

In your example, what gets sent to the server is roughly the
following:

Query:
"Select ID, Name From myTable Where ID = @id"
Parameters:
@id, 14

Do some web searches for "parametrized query" and "SQL injection
attack" for more info.
Jun 27 '08 #2

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

Similar topics

2
by: theWizK | last post by:
Hello all. I have noticed that when I generate a strongly-typed dataset from an xml schema that the DataTables that are generated have their constructors marked as internal. What this means is...
1
by: Nedu N | last post by:
Hi All, I am facing problem in copying content of table from a untyped dataset into to a table inside the typed dataset. I wanted to copy the data into typed dataset in order to ease the further...
5
by: Sadun Sevingen | last post by:
hi i get dataset from'an webservice so i don't have an adaptor... dataset's structure is same as mine database table.... how can i update database table according to dataset...
2
by: BlackHat | last post by:
I am currently working on a program that will connect to a MySQL server, and manipulate data in a datagrid. However, I'm having trouble understanding a lot of the process. I need help...
2
by: Nedu N | last post by:
Hi Techies, I am facing problem in copying content of table from a untyped dataset into to a table inside the typed dataset. I wanted to copy the data into typed dataset in order to ease the...
16
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill...
4
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
0
by: Annie | last post by:
hello guys, I have created the BLL and DAL using the microsoft strongly typed datasets. There are couple of problems here: 1- The table adaptor object Insert method accepts arguments for all...
8
by: Harry Strybos | last post by:
Visual Studio 2005 - SP1 - VB.Net on WinXP SP2 I add a typed dataset to my solution and get the following errors : Error 1 sub 'ReadXmlSerializable' cannot be declared 'Overrides' because it...
21
by: Peter Bradley | last post by:
Hi all, This post is sort of tangentially related to my earlier posts on configuration files for DLLs. Does anyone know how to create typed DataSets using VS2005's new DataSet designer, but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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:
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...

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.