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

Moving SqlDataSource to ObjectDataSource. need help

Hi everybody
I am converting my pages to use ObjectDataSource instead of
SqlDataSource and want to keep the same user interface but have a small
problem.

In a page using SqlDataSource I have a textbox where user can input the
query (whole query in SQL). Then by clicking the search button I was
using it as: SqlDataSource1.SelectCommand = txtQuery.Text.
I want to have the same interface into a converted page where I am
using ObjectDataSource.
How can I do this?

I can probably have a select method where there will a parameter for
every column and then have a textbox for every column in the page where
user can enter search parameters and it may work as well, but I am
using this project only inside the company where only people having the
knowledge of SQL are using it, so they can write their queries fast and
check what they want.

Can someone tell the answer or guide to a link?

Thanks in advance
Raja

Aug 31 '06 #1
1 1459
You will have to create an object with the job of delivering SQL. The SQL
string will then be sent to the database from the object and run. Since you
are dealing with random FUD, you will likely have to return a Random
DataSet.

NOTE: This is not a good security practice, as anyone with a SQL background
can do major damage to your database with this wide open ability. You should
restrict the account that can run queries this way to only being able to
query tables that it should have access to and stop any security SQL or DDL
from running under this account.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"Raja" <ra***********@gmail.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hi everybody
I am converting my pages to use ObjectDataSource instead of
SqlDataSource and want to keep the same user interface but have a small
problem.

In a page using SqlDataSource I have a textbox where user can input the
query (whole query in SQL). Then by clicking the search button I was
using it as: SqlDataSource1.SelectCommand = txtQuery.Text.
I want to have the same interface into a converted page where I am
using ObjectDataSource.
How can I do this?

I can probably have a select method where there will a parameter for
every column and then have a textbox for every column in the page where
user can enter search parameters and it may work as well, but I am
using this project only inside the company where only people having the
knowledge of SQL are using it, so they can write their queries fast and
check what they want.

Can someone tell the answer or guide to a link?

Thanks in advance
Raja

Aug 31 '06 #2

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

Similar topics

3
by: Asaf | last post by:
Hi, I have SqlDataSource control that makes a "select count" to show how many rows there are in a Table and it is working fine on first page load. The problem is that when I am inserting a new...
2
by: djc | last post by:
1) I am wondering if I should be using an sqlDataSource object for my particular scenario. I need to loop through a listbox and perform an INSERT sql operation for each item. Could be a few or...
4
by: Mike | last post by:
Is there any difference in performance between a SqlDataSource and an ObjectDataSource - assuming they are being deployed to perform the same task against a SQL Server database? Mike
1
by: jobs | last post by:
I have a GRIDVIEW I have bound to an OBJECTDATASOURCE that has the select pointing to a class method that uses ADO to grab a dataset from SQL Server Stored Procedure. One of the columns that...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.