473,403 Members | 2,183 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,403 software developers and data experts.

MySQL and Oracle using SqlDataSource control

I am creating a web app that needs to distribute to be able to be
distributed to MySQL sites and Oracle sites. So far I have developed
it for MySQL and now I am going back and adding Oracle support. I am
having trouble with my SqlDataSources; the app is full of them. When I
am using my MySQL connection it takes parameters like
UserDepts.user_uid = @user_uid

But, when the connection is an Oracle connection I don't know what
they're supposed to look like. I know the parameter is " :user_uid "
but it's not working with just that change. I thought the framework
was supposed to make it so that all I do is change the connection and
all this would be taken care of, but now it looks like I am going to
have to go to every page and do a ...

if(isOracle())
{
SqlDataSource1.SelectCommand = "SELECT DISTINCT
DEPARTMENTS.DEPT_UID, DEPT_NAME FROM DEPARTMENTS INNER JOIN USERDEPTS
ON USERDEPTS.DEPT_UID = DEPARTMENTS.DEPT_UID WHERE USER_UID = :user_uid
AND DEPARTMENTS.MARK_BYTE <1 ORDER BY DEPT_NAME";

}
else
{
SqlDataSource1.SelectCommand = "SELECT DISTINCT
Departments.dept_uid, dept_name FROM Departments INNER JOIN UserDepts
ON UserDepts.dept_uid = Departments.dept_uid WHERE user_uid = @user_uid
AND Departments.mark_byte <1 ORDER BY dept_name";
}

for every SQLDataSource plus whatever changes I will still need to make
to make it actually work (like put something inside quotation marks).
That's terrible! There has got to be a better way!
(not to mention the stored procedure nightmare I'm fixing to go
through) So what other changes do I need to make to the SQL statement
and is there a way to avoid this entirely? I sure hope so.

Thanks for any help,
-Seth

(if this needs to be in another group, just let me know)

Aug 30 '06 #1
0 1312

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

Similar topics

175
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I...
1
by: pete | last post by:
I seem unable to get the FormView with the SqlDataSource control in ASP.NET 2.0 beta 2 to insert into my MySQL 4.11 database corectly. When I run the page and click on the Insert link a SQL insert...
5
by: rockdale | last post by:
Hi, All This is the first time that I code asp.net against mySQL database. I am confused that which connector should I use 'cause I do not want make the wrong choice and have some problems later...
0
by: Brew | last post by:
Hello, I'm writing an ASP.NET 2005 (VB) Website with an Oracle 9i backend I have an oracle package with stored procedures and functions I need to use from the VB Code, I'm trying to use the...
5
by: msch-prv | last post by:
Hi, I am trying to tie a SQLDataSource control to MySQL without success. The connection string works ok with an ObjectDataSource. (Native asp.net 2.0 MySQL dll loaded in /bin) For some reason,...
0
by: george | last post by:
Hi world! Anyone experienced building gridview in Oracle environment using stored procedures, please help! Right now, I have issues using Oracle SP, I spent a whole day on this and still...
2
by: rcc.gamer | last post by:
Hello All, I am trying to connect a GridView to an Oracle table using the standard SqlDataSource. The process is fairly simple and there are detailed instructions from Microsoft ......
1
by: Ted | last post by:
In MS SQL I used the following to create a stored procedure. USE AdventureWorks; GO IF OBJECT_ID ( 'HumanResources.usp_My_Search', 'P' ) IS NOT NULL DROP PROCEDURE HumanResources.usp_My_Search;...
1
by: Evan M. | last post by:
Hello, I'm creating a web app that needs to provide some simple, read-only access to an Oracle database using SELECT statements. What I am curious about is which provider...
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:
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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.