473,396 Members | 2,113 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,396 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 1234

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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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...

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.