473,399 Members | 3,603 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,399 software developers and data experts.

Working with Gridview & Oracle

Hello,

I'm working on an ASP.NET project (VS 2005) utilizing an Oracle
database backend. While I understand that Gridview's are a breeze to
work with using SQL Server (hundreds of sites point that out), I don't
have that option. So I have a couple questions.

1> Does anyone know of some (presumably good) resources of utilizing
ASP.NET against non-SQL Server backends?

2> The issue that I'm having right now is, in my gridview, I have the
Edit, Delete, Select options enabled. When I click Edit, I have to
click it twice. On the first click, it goes through the OnRowEditing
event, just as expected, and on the second click, it goes through the
OnRowEditing... however, the edit boxes aren't visible to me until
after the second Edit click. Same thing with the Cancel (during an
edit). Clicking Cancel once runs it through the events I expect, but
it's not until the second click that the row actually goes back to it's
proper state.

Thanks in advance,
Mike

Jan 20 '06 #1
4 2579
Okay, ignore question 2, I got it figured out.

Jan 20 '06 #2
Hello Mike.
Not sure what is meant by "good resources of utilizing ASP.Net against
non-SQL Server backends....

The access for SQL Server and Oracle are very similary in nature. I would
recommend that you download the Oracle drivers for the .Net platform and use
them, but the Microsoft version works. Once you figure out the connection
information, everything is pretty much the same. So perhaps you could
elaborate a bit more on what you are looking for.

Jan 20 '06 #3
The way I do it is to build a Business Logic Layer that is independent from
the data access layer. (My website for example does not disclose the data
access backend and I rely on using objectDataSource to query my BLL)

The data access layer would be a project that has a reference to the
System.Data.OracleClient namespace. In this project I would add functions to
return data by querying stored procedures (packages), e.g.

Public Function DataSet1(ByVal PARAM1_VALUE As String, ByVal PARAM2_VALUE As
Integer) As DataSet
dim ds = New DataSet

dim cmd = New OracleCommand

cmd.CommandText = "ORACLESCHEMANAME.ORACLETABLE.STOREPROCNAME"
cmd.Parameters.Clear()
cmd.Parameters.Add(New OracleParameter("res_cur",
OracleType.Cursor)).Direction = ParameterDirection.Output
cmd.Parameters.Add(New OracleParameter("PARAM1", OracleType.Char,
2)).Direction = ParameterDirection.Input
cmd.Parameters.Add(New OracleParameter("PARAM2",
OracleType.Number)).Direction = ParameterDirection.Input
cmd.Parameters("PARAM1").Value = PARAM1_VALUE
cmd.Parameters("PARAM2").Value = PARAM2_VALUE
cmd.CommandType = CommandType.StoredProcedure
strCon = AppSettings("DBConnectionString") 'This where you store the
connection string to ORALCE
'e.g. in the web.config you would have
'<configuration>
'<appSettings>
' <add key="DBConnectionString" value="user id=mysuername;data
source=schemaName;password=mypassword;Connection Lifetime=3600" />
'</appSettings>
con = New OracleConnection(strCon)
con.Open()
cmd.Connection = con
da = New OracleDataAdapter(cmd)
da.Fill(ds, "TABLE1")
da.Dispose()
con.Close()
return ds
End If
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"an*******@gmail.com" wrote:
Hello,

I'm working on an ASP.NET project (VS 2005) utilizing an Oracle
database backend. While I understand that Gridview's are a breeze to
work with using SQL Server (hundreds of sites point that out), I don't
have that option. So I have a couple questions.

1> Does anyone know of some (presumably good) resources of utilizing
ASP.NET against non-SQL Server backends?

2> The issue that I'm having right now is, in my gridview, I have the
Edit, Delete, Select options enabled. When I click Edit, I have to
click it twice. On the first click, it goes through the OnRowEditing
event, just as expected, and on the second click, it goes through the
OnRowEditing... however, the edit boxes aren't visible to me until
after the second Edit click. Same thing with the Cancel (during an
edit). Clicking Cancel once runs it through the events I expect, but
it's not until the second click that the row actually goes back to it's
proper state.

Thanks in advance,
Mike

Jan 20 '06 #4
Jim,

Sorry, I should have been more clear on my question, my apologies...
however..

Phillip,

That is exactly the direction I needed! Thank you very much. I was
choking on getting oracle to work as a sqldatasource with the ref
cursors and such, and creating and attaching this object to the
gridview provided all the functionality I needed right off the bat...

Thanks again!

Mike

Jan 20 '06 #5

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

Similar topics

0
by: rob | last post by:
Here is my scenario: One of my aspx pages has a CheckBoxList (Item1, Item2) and a GridView. Then I have a database that has the columns Item1 and Item2 (among others) with the data type bit....
0
by: ʹÃûÑï | last post by:
ORA-03114: not connected to ORACLE && MS's Bug?? DataBase:Oracle 817 using OracleClient,net framework 1.1 I'm using ADO.Net in C# with Oracle 817. and following is my public data access...
0
by: sreejith.ram | last post by:
I did google & search in this group , but couldnt find any thing related to this. This is my first attempt to connect GridView to a Oracle database via SqlDataSource. I am receving error message...
2
by: guanfenglin | last post by:
Hello, I have a grid view which display and updates the data, however it doesn't work well, I always either get invalid name/number or not all varaibles bound, I am very frustrated at the...
1
by: Kyle K. | last post by:
I would like to build my data pages such that the top of the page contains a GridView showing the data with 'Enable Select = true'. Below that I would like to have a FormView, that by default is...
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 ......
2
by: Ixnay | last post by:
Thanks in advance for any help you can give me on this. I am trying to include the value from a request.querystring in the DataNavigateUrlFormatString I am able to include one of the values...
5
by: Cindy Lee | last post by:
I'm getting my data from an XML file. The data binds fine, but I can't sort on it. Do I have to do anything special? I have enabled sorting on my grid view. Autogenerate columns is off, and I...
7
by: Sahar Madahian | last post by:
Hi! I have a girdview that use oracle database, the result is more than more page, how could I show the result in many page? I used AllowPaging="True", but the just the result of page one was...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.