Jump to content
Xtreme .Net Talk

jdink22

Members
  • Posts

    10
  • Joined

  • Last visited

jdink22's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I was able to get this working using the "copy" method i described above. I am having some dataset update issues, but i don't know if they are related to using the copy method or not. Does anyone know of any issues or reasons why this would be problematic? Thanks in advance for any advice!! :p
  2. Finally got this one to work - thanks!! :cool: *****RESOLVED*****
  3. Thanks - i found a creative work around! *****RESOLVED*****
  4. I looked at using the .compute function, but I wasn't quite sure how to apply it...Don't I still need to iterate through each row of the first table (dates) in order to get the total for the related rows for each individual date? :confused:
  5. i have a datagrid that displays two levels of information based on a relationship. The first level is simply dates, which link to the second level which is tasks associtated with that date. I want to also include a "total hours" column in the first level/parent datatable. What would be the best way to cycle through this hierarchy and get the total hours for each row related to each unique date? (please see attached file for a snapshot of the grid). So for the example I have attached, the "Total Hours" column in the first level will read "4". i was thinking something along these lines: Dim drow As DataRow Dim trow As DataRow Dim totalHours As Integer For Each drow In das1.Tables("temp_Dates_table").Rows For Each trow In das1.Tables("job_item_info").Rows ****totalHours = totalHours + das1.Tables("job_item_info").Columns("quantity") **** (this line is the concept only) Next das1.Tables("temp_Dates").Columns("hourstotal"). = totalHours Next [edit]Please use more sensibly sized attachments in future[/edit]
  6. Is there a way to limit the dates a user can select from a date/time picker? Or is there a good way to populate a dropdown list of dates they can pick from? The background is that I am constructing a timesheet of sorts and want them to only be able to pick from the 1st or 16th of every month (as those dates coincide with the beginning of a new time period) so that i can generate a table for the 15 days following the date they pick. Which actually brings up another issue - if they pick the 16th, how can i account for months with 31 days without having the 16th date generated be the 1st of the next month? Thanks in advance for any help!!
  7. I haven't had much luck with the checking/removing constraints still. If i were to resort back to the "reset" option for the dataset, do you have any words of wisdom in that arena? I found an issue similar to mine on another board, but i wonder if this would work for me if it were "adapted" to VB??? ********** I have a global dataset object ds that is populated by using ds.readXml(fileName) in a procedure, then bound to a Windows.Forms.DataGrid. Everything is OK so far. The data shows on the dataGrid. But the second time the same procedure is called, nothing shows up on the dataGrid and no error messages. Everytime, before the dataset is popluated, it is reset by using ds.reset ( I also did ds.clear(), and ds.Relations.Clear() to make it cleaner). Also by debugging it, I can see the ds has the same XML string the second time by using ds.getXml. And if I bind the DataGrid using a copy like the following: dataGrid1.SetDataBinding(ds.Copy, "Entry") Everything is working. What's going on here? (REPLY) I suspect the data binding is not updated timely after you repopulate the DataSet. To workaround it, you may refresh the binding with the original DataSet: Object source = dataGrid1.DataSource; dataGrid1.DataSource = null; dataGrid1.DataSource = source; I hope this helps you. ***********
  8. i got the same error upon trying to remove the constraints. i am including my code if you have time to look at it. i feel like i'm probably just going about the order of things incorrectly, as i am a first time coder....but if you do have time, i'd greatly appreciate some help!!! :confused:form5.txt
  9. sizer-thanks for the quick response. yes, i did try removing the table but when i do, i get this error:**An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll - Additional information: Cannot remove a table that has existing relations. Remove relations first.** So then i tried to both clear and remove the relationship and got this error: **An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll - Additional information: Cannot remove table Temp_Dates, because it referenced in ForeignKeyConstraint DatesToJobItems. Remove the constraint first.** and this is where i am stuck and why i tried to go with the "reset" route. any ideas?
  10. i have a datagrid that i am populating with two tables, one of which comes from a sql table, the other is programmatically generated. the first table is just populated with dates, according to the value the user selects in a date/time picker. so the date table is populated and then related to a task table via the date field. the problem i am having is that when the user selects a date, the grid populates with related data from both tables (as it should). However, when the user attempts to select another date in the same session, the dataset will not repopulate. i was getting an error about the table already being in the dataset (which makes sense, because it was generated the first time the user picked a date). so....i tried to delete the dataset, but it said i needed to delete the relationship, and then it says i need to delete the foreign key constraints....and so on. so i opted to "reset" the dataset if it already existed so that it would repopulate upon selecting another date. now what i am getting is a blank table, but it does not crash. any ideas on how to approach this?
×
×
  • Create New...