Jump to content
Xtreme .Net Talk

hog

Avatar/Signature
  • Posts

    1011
  • Joined

  • Last visited

Everything posted by hog

  1. in an ideal world!.....
  2. Further explained. Lets say the original sql returned 2 records, if I don't use .clear first as shown then each time the .fll is called the record count is doubled.
  3. I don't think you follow what I'm doing? this code works as is in five other forms, so I cannot see why it won't work here. If I comment out the update line I get an error on the Fill line saying the select statement is not set. Yet it is set!
  4. I am updating the datasource.
  5. OK this might explain why I do it this way. This section fires when a user clicks a radio button to say they want to see live only or live and archived items: Private Sub Radiobutton_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles radLiveOnly.CheckedChanged, radLiveAndArchived.CheckedChanged ' only do this if form is not refreshing If Not blnRefreshingForm Then Dim ctlSender As RadioButton = DirectCast(sender, RadioButton) ' ensure we are pointing at correct data Me.OleDbConnAssets.ConnectionString = gconnConnection ' determine who called this event and set selectcommand text accordingly Select Case ctlSender.Name Case "radLiveOnly" Me.OleDbAdapterAssets.SelectCommand.CommandText = "SELECT assetid, supplierid, model, type, '[' + type + ']' " & _ "+ ' ' + model + ' ' + serial AS description FROM tblAsset WHERE (active = - 1) ORDER BY type" Case "radLiveAndArchived" Me.OleDbAdapterAssets.SelectCommand.CommandText = "SELECT assetid, supplierid, model, type, '[' + type + ']' " & _ "+ ' ' + model + ' ' + serial AS description FROM tblAsset ORDER BY type" End Select ' refresh the suppliers combo box ResetDataset() End If End Sub Private Function ResetDataset() Try ' empty asset dataset prior to refreshing Me.DataSetAssets1.Clear() ' regenerate asset dataset to reflect changes Me.OleDbAdapterAssets.Update(Me.DataSetAssets1) ' fill the dataset with refreshed data Me.OleDbAdapterAssets.Fill(Me.DataSetAssets1) Catch objException As Exception ShowError("Location: Class frmAssets" & ControlChars.CrLf & ControlChars.CrLf & _ "Procedure: ResetDataset" & ControlChars.CrLf & ControlChars.CrLf & _ "Error Text: " & objException.Message) End Try End Function therefore though this code a combobox on the form will display either all live or live and archived depending on which radio button they click. this method works perfectly fine on five other forms?
  6. not sure if this is what you want? <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.OleDbAdapterAssets.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "tblAsset", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("assetid", "assetid"), New System.Data.Common.DataColumnMapping("active", "active"), New System.Data.Common.DataColumnMapping("model", "model"), New System.Data.Common.DataColumnMapping("serial", "serial"), New System.Data.Common.DataColumnMapping("supplierid", "supplierid"), New System.Data.Common.DataColumnMapping("type", "type")})}) I thought maybe the first mention of Table above was to blame, but it is not as all other forms are identical to this, apart from actaul table and field names
  7. OK I have narrowed down to when the error occurs. It happens in the Windows Form Designer Generated Code when InitializeComponent() is called. The section of code I posted above is in a RadioButton CheckedChanged event, which InitalizeComponent() is obviously calling? This happens on all the other forms I've coded this way but they are OK?? I have deleted all sections of related code, the dataset and the data adapter and re entered it and it is still happening. Any ideas?
  8. the selectcommand text is set elsewhere and this code is called to refresh the combobox that's bound to the dataset. There if a user selects they only want to see live records the clear method empties the dataset and the update reloads with just the live records. Likewise if the user want to see live and dead records the same process happens. And again if new records are appended then the reload takes place.
  9. try this: m_odaWhatever.Fill(m_dsWhatever, "TableNameWhatever")
  10. do you run the component update and check the VS web site for service releases after you installed?
  11. The dataset Me.DataSetAssets1 has one table in it, tblAsset
  12. This one is driving me nuts as I have identical code in multiple forms which work fine, but for some reason this one does not! Try ' empty equipment dataset prior to refreshing Me.DataSetAssets1.Clear() ' regenerate item dataset to reflect changes Me.OleDbAdapterAssets.Update(Me.DataSetAssets1) ' fill the datasets with refreshed data Me.OleDbAdapterAssets.Fill(Me.DataSetAssets1) Catch objException As Exception ShowError("Location: Class frmAssets" & ControlChars.CrLf & ControlChars.CrLf & _ "Procedure: ResetDataset" & ControlChars.CrLf & ControlChars.CrLf & _ "Error Text: " & objException.Message) End Try An error occurs at the .Update line which reports the following: Update unable to find TableMapping['Table'] or DataTable 'Table'. If I generate and preview the data adapter in design mode it works OK?
  13. post your code so we can see what you are doing.
  14. Ta very muchly :-)
  15. Well my name is Hogan, my nick name for years has been hog as well as el puerco. So hog, el puerco........pig theme. :-)
  16. you can find my very sad web site at http://www.elpuerco.co.uk As I said in my other post, I'm always game for a laugh and that's about it......I ain't hurtin' no one:)
  17. Divil, this does not work as I still see the momentary blip. My form if 300*300 with an image on it, I change it to 600*600 and there is a split second where you see the form resizing but with the image still at 300*300, then the image changes to 600*600
  18. First of all create a data adapter which will contain the required fields on you report, this is so the fields are available at run time. Create a dataset in code that will be filled with the data depending on the selection by the user, then set this dataset as the reports reportsource. I have a single report that services four different datasets using this method. As for the textbox, you will need to create a formula, in Field Explorer right click Formulas, then select New
  19. .....$3.19! I was amazed at the price. I get my own domain name for $3.19 per year. Then $3.19 per month for 8 web pages, 15 email address, online/telephone support and the use of online web creating software that creates my site in easy steps. No html training or anything. This will do me for starters to get me out there quickly, then I'll look into html and the rest if I get a big enough kick out of having my own site.
  20. HoHo when I can get this online software to save my changes and then publish it! I've been trying all night on and off, but it keeps saying try later. Just a note......you will all think I'm a complete twonk when finally it is out there, but hey......I'm always game for a laugh and when you finally get to see it hopefully you'll see that the topic actually is related to me in a personal sense. soon....be patient,
  21. Mmm that is interesting, I didn't know that either!
  22. Nuff said apart from who said I was arguing? Not why I use this site....we all have our own views, being a boring world if we all thought the same. :-)...........end
  23. Nah, have to disagree on this one. This falls into the same argument re Windows V Linux, you're either one or t'other. The mention the Format function was an example. I mean, why bother wasting time writing your own Format function when there is already one there that fits the purpose? A bit like why re invent the wheel? Any way we have two schools of thought here, both of which can be viewed a right. I get where you are coming from when you want to get every last bit of performance, but for the average application as far as the ones I write this is not an issue. In my line writing a custom Format, IsNumeric etc just ain't worth the effort :-)
  24. Dim frmForm As New frmWhatEver() frmForm.Show()
×
×
  • Create New...