Solved

Add to a dataset

Posted on 2007-03-23
3
156 Views
Last Modified: 2010-04-23
I am getting an error "there is no postion in row 0"    when I try to perform the action   DsmhcpTreatmentPlan1.Tables(0).Rows(DataGrid2.CurrentCell.RowNumber).Item(4) = lngpatientid  

How can I fix this please.  

Thank you
0
Comment
Question by:running32
  • 2
3 Comments
 

Author Comment

by:running32
ID: 18781724
I do not have any records in the dataset and would need to add one I'm guessing.  The code below does not work it states.   Add is not a member of system.data.datatable

  Dim rowTemp As DataRow
            rowTemp = DsmhcpTreatmentPlan1.Tables(0).NewRow()
            rowTemp.Item("lngPatientid") = lngpatientid
            DsmhcpTreatmentPlan1.Tables(0).Add(rowTemp)
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 18782688
You're close:

  Dim rowTemp As DataRow
            rowTemp = DsmhcpTreatmentPlan1.Tables(0).NewRow()
            rowTemp.Item("lngPatientid") = lngpatientid
            DsmhcpTreatmentPlan1.Tables(0).Rows.Add(rowTemp)
0
 

Author Comment

by:running32
ID: 18793379
Thank you
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now