PC Review


Reply
Thread Tools Rate Thread

Dataview not showing updates with AutoFill in Excel

 
 
New Member
Join Date: Jan 2008
Posts: 1
 
      16th Jan 2008


built an excel add in with a custom save button to gather data from an excel workseet, and call a stored procedure to save this new data.


When I try to use the Auto Fill feature in excel, I am able to drag a value(copy) with my mouse to cells underneith the selected cell - this part is fine. I can see the values in the cells below on my excel sheet, all the same, which is what I want. The problem is when I try to see the rows which have values that are changed/updated in a dataview in the vb.net code. The dataview object only seems to have the first cell that was changed. It is as if the other 30+ cells that I copied data into, did not register, even though they are clearly there on the excel worksheet, so my datarowview object only has 1 element and not 30.

I am trying to use a datatable object to create a dataview. With the dataview, I try to use a foreach loop to iterate through the dataview with datrowview objects. Also, in this column I am validating the data entered through a list. So, when you click on the cell, a validate box is avaiIable for the user to choose only from a list of 10 items. have researched trying to recalculate the range object as well as the worksheet object with the calculate() method, but nothing seems to work. Last, I also considered using the DataSetName.AcceptChanges() method to try to force the data to be updated, but this didnt seem to work for me. Has anyone had this same problem?


Here is the relevant code....

rangeObject.Calculate()

worksheetName.Calculate()

DatasetName.AcceptChanges()



Dim
dv AsNew DataView(DatasetName.Tables(0))
'Dim dv As New DataView(dt)

dv.AllowNew = True

dv.AddNew()

dv.AllowEdit() =
True

'dv.RowStateFilter = DataViewRowState.ModifiedCurrent - commented out for experiments

dv.RowStateFilter = DataViewRowState.CurrentRows


ForEach dvr As DataRowView In dv

''Try to read each cell in each drv to get parameters to send to a stored procedure

Next


Note: The stored procedure works for the first one(since there is data)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorted DataView, but unsorted datalist when bound to the dataview CodeMonkey Microsoft ASP .NET 1 4th Feb 2011 10:55 AM
Excel Autofill Showing Mondays ONLY in a calendar year S1 Microsoft Excel Programming 1 4th Feb 2008 05:38 PM
Migrating VBA to Excel 2007 - AutoFill & Excel Object Error - ExcelFrom AutoCAD 2004 amiga.user Microsoft Excel Programming 1 5th Jul 2007 11:53 AM
Updates still showing up under Choose Updates To Download JasonA Windows XP General 4 27th May 2006 06:53 AM
Is there an easy way to copy a DataView (or even the DataGrid showing the DataView) to the Clipboard? Kevin Brown Microsoft Dot NET 4 5th Jan 2005 09:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:23 PM.