472,985 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,985 software developers and data experts.

How to access the data in a detailsView-- ASP.NET 2.0

Hi,

I have a webpage which has a detailsView control with no paging. On the page's button click event, I need to access one data field to make a desicion.
I have the this detailsView bind to objectDatasource which comes from a dataset called dsRequest.
Here is my code, but I got a "object not set to instance" error which almost drove me crazy. Please help me out. Thanks a lot.

code:

Dim shipmentID As DateTime
Dim request As dsRequest.REQUESTRow
'Got 'object not set to instance' error on the following line
request = CType(CType(requestDetailsView.DataItem, System.Data.DataRowView).Row, dsRequest.REQUESTRow)
If Not request.IsShipmentIDNull() Then
shipmentID = Now()
myDB.InsertShipment(shipmentID)
Else
shipmentID = request.ShipmentID
End If
Session("shipmentID") = shipmentID
Response.Redirect("~\somepage.aspx")

I know I can query the database to get this field value out, but is there another way besides that?

Kity
May 23 '07 #1
0 1209

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: m3ckon | last post by:
Hi there, I'm trying to come up with a definitive list of ACcess data types that cause a problem when upsizing to SQL Server. On the last occasion that I upsizzed, SQL Server had an issue with...
2
by: Ebbie | last post by:
Hi, I wanted to know if Access Data Projects is a good option to choose for a SQL Server Database Frontend. The other option is C#. The database will be accessed by multiple users (around 100...
5
by: David | last post by:
Is the Access Data Engine part of the VS/.net install. Eg. I need to write a stand alone Form app for which a small DB would be helpful. IN VB 6, I would use ADO to call the Access engine. I...
1
by: Aravind | last post by:
Hi guys, In c#, How to dispaly the records from a AccessDB to a Windows Forms DBgrid.. Is there any need of creating datasources like in VB data access.
0
by: shapper | last post by:
Hello, I have a Connection String defined in my Web.Config: <connectionStrings> <add name = "dbAccess_JaquelineRoxoAtelier" connectionString = "Provider = Microsoft.Jet.OLEDB.4.0; Data...
1
by: swynne | last post by:
Hi friendly people...I am a newb to programming and need a little assistance. I have a small personal ad database created in Access, however all is well until I want the personal ad link to take me...
7
by: Finger.Octopus | last post by:
How to access data from MS Access? I tried ADOdb for Python but it doesn't seems to work. Even the official examples dont work, like this one: import adodb conn =...
4
by: Joe101 | last post by:
Question: How to put access data base onto a web page?
2
by: Carla Hepker | last post by:
I have several in-house applications that I have developed over the years using vba in Access Data Projects. When we converted the SQL server over to 2005, some of the sorts no longer functioned...
7
ADezii
by: ADezii | last post by:
There are essentially three techniques for publishing Access Data on the Web. The first technique is static, and does not allow for the dynamic addition or modification to the data, There is no...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.