Jump to content
Xtreme .Net Talk

edmund

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by edmund

  1. It is loaded with null values to begin with. I assume, since i use the .fill method of the adaper and the fields are null initially in the sql server table.
  2. don't know i use .fill to load the table it has null values everywhere at first until its edited. There are four fields, product and editable fields regprice, salecode (the one i'm trying to handle), and sale price. everything works fine until i add the handler which i assume only meddles with the salecode column. yet the error is envoked by edits to the other fields. hmmm
  3. System.InvalidCastException: Cast from type 'DBNull' to type 'String' is not valid. problem is ado.net is processing the update not sure what exactly is the cause. Heres the code first I have a handler in the form load: AddHandler DsSurveyPricesEntered1.Tables("SurvPric").ColumnChanging, AddressOf SaleCode_ColumnChanging The sub that handles it: Private Sub SaleCode_ColumnChanging(ByVal sender As Object, ByVal e As System.Data.DataColumnChangeEventArgs) ' Only check for errors in the Sale Code column If (e.Column.ColumnName.Equals("SaleCode")) Then ' Do not allow certain codes Dim CodeValue As Object = e.ProposedValue If e.Row.HasErrors Then e.Row.ClearErrors() End If Select Case CType(e.ProposedValue, String) Case "1" e.ProposedValue = "b" Case "2" e.ProposedValue = "pl" Case "3" e.ProposedValue = "/" Case Else e.ProposedValue = Nothing End Select End If End Sub works fine until i go to save using ado.net here: Private Sub SavePrices() '***** this is where it blows up ******* Me.OleDbDataAdapter3.Update(DsSurveyPricesEntered1) '***** end where it blows up ******** 'update the sale codes Me.UpdateCodes() Me.OleDbDataAdapter3.Fill(DsSurveyPricesEntered1) oSess = Nothing End Sub *** If I comment out the handler the table updates fine no problems but I need it. or something similar. Any ideas would certainly be appreciated. Thanks Ed
  4. bump. Lost need some help. Tried numerous methods still can't respond to the user pressing the enter key when the data is either null or wasn't edited. there has to be a way to write a handler for this event. hmmmm?
  5. more specific its a vb.net app in the formload i add a handler: AddHandler DataGridPricing.KeyPress, AddressOf PricingKeyPressed and the sub: Sub PricingKeyPressed(ByVal o As Object, ByVal e As KeyPressEventArgs) 'Dim clsPricing As New PricingDataGrid If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then SendKeys.Send("{DOWN}") End If End Sub Why doesn't this work, please if someone could help me, it would be appreciated.
  6. How does one make the enter key act as the down arrow when manuevering through a datagrid? I know this happens when someone enters a value in the cell. But it appears that if the cells value is null the cursor just stays there when the user hits the enter key. Only the down arrow key will move the cursor down to the next cell. There has to be a way to override the default behavior. Also is it possible to lock the cursor out of certain cells? Any help would certainly be appreciated, Thanks.
  7. Interesting, I'm not sure I can use ADO with MySQL, learning curve I guess. Thanks
  8. Thanks, I'll look into it and let you know what happens. Would you know how to bypass the prompt for a parameter field?
  9. ok here is the scenario. The report/form is already designed to the specs (it has to look close to exact as a CA state form. There are 4 rows to a page that could be multiple pages. These rows have contain 14 data items (fields) to populate psuedoo checkboxes(an "X" inside a box), text and currency types. To get the data required to populate the form it requires multiple joins and nested recordsets. Now, its a client server app, my solution was to grab the data and store it in a table emulating a row in the form based on the system users id and indexed by an identity so that I can create new instances of the report populate it, preview it, print it then dump the data. In the crystal report itself I get the data by storing a sql command: "SELECT * FROM tablename WHERE useid = 1 order by id" The report populates beautifully. I just want to change the 1 (ie user id) in the query, depending on the user. How does one change the query at runtime? There's got to be a solution to this. Scenario number two basing a report on a date range. Another just change the query situation. hmm Any help would certainly be appreciated.
  10. I have a report designed in crystal reports (CR for .NET) using a MySQL database. The report is based on a query, which is set in the report. My headache is that I can't figure out how to change the query at runtime using vb.net. Any help would be truly appreciated. Thanks
×
×
  • Create New...