AnandSahoo
asked on
How to connect to a oracle database and run some sample query using ASP.NET
Hi Team,
Need your help in the following.
I have a odbc connection configured in my PC for oracle database. (Oracle for orahome92)
using Visual studio web developer 2008 version (Express edition free version),
need to connect to the database using connection string.
then run 2 distinct count queries like
select distinct count empid where dept = finance
select distinct count where sal > 10000and dept = finance
2nd one is subset of first one
Just need one page web screen to show the values returned in the above queries.
then also show the percentage of it on the screen
Have tried many connection string.
Either I am getting error in connection or if its connecting unable to execute the query to return the value and show on the screen.
Request your help
Need your help in the following.
I have a odbc connection configured in my PC for oracle database. (Oracle for orahome92)
using Visual studio web developer 2008 version (Express edition free version),
need to connect to the database using connection string.
then run 2 distinct count queries like
select distinct count empid where dept = finance
select distinct count where sal > 10000and dept = finance
2nd one is subset of first one
Just need one page web screen to show the values returned in the above queries.
then also show the percentage of it on the screen
Have tried many connection string.
Either I am getting error in connection or if its connecting unable to execute the query to return the value and show on the screen.
Request your help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could use a LinkServer (in the SQL Manager), however you gonna have a problem in the x64 systems...
ASKER
Hi srosebabu,
This is really helpful. I got something to start with.
I am able to show the value in a text box.
Can you also help me with the following ?
1. If I have multiple queries to run,do I have to take multiple commands and readers ? OR I can close one and use the same name to run another query ?
2. I want to format the query result count in colors. Lets say if its more than 90 then it should show green,80 to 90 amber and less than 80 red,how can I achieve this. The values are shown in textbox.
3. Instead of count (*) if I need to take the rows and column values returned, What are the changes I need to do ?
This is really helpful. I got something to start with.
I am able to show the value in a text box.
Can you also help me with the following ?
1. If I have multiple queries to run,do I have to take multiple commands and readers ? OR I can close one and use the same name to run another query ?
2. I want to format the query result count in colors. Lets say if its more than 90 then it should show green,80 to 90 amber and less than 80 red,how can I achieve this. The values are shown in textbox.
3. Instead of count (*) if I need to take the rows and column values returned, What are the changes I need to do ?
ASKER
Thanks I got the solution.
Will ask about more in ASP .net in future
Will ask about more in ASP .net in future
ASKER
That was helpful