Jump to content
Xtreme .Net Talk

penfold69

Avatar/Signature
  • Posts

    135
  • Joined

  • Last visited

Everything posted by penfold69

  1. If you are using a CommandBuilder to generate the SQL statements for an update, then any record changed between a .Fill and an .Update will generate a concurrency exception (DBConcurrencyException) which you can handle yourself. If you are generating the SQL yourself, then you can obviously decide what happens within your SQL statement or prepared statement. Either way, these kind of errors are very easy to trap - the hardest bit is the business logic to recover from them, which you must already have from your VB6 application. B.
  2. Hrm, I don't directly use the SQL/ODBC/OLE libraries - I interface with a MySQL server using the Connector/NET. The way that they handle it is that after the .Update command, the dataset ID field will contain the actual inserted ID from the database. So, if you know which row you added, (or can find it) then perhaps you can retrieve the ID from it, after issuing the .Update statement? B.
  3. try changing: If lstTickets.SelectedItems.Count = 0 Then MessageBox.Show("You must select a ticket to view") Else strSelTicket = lstTickets.SelectedItems(lstTickets.SelectedItems(0).Index).Text to: If lstTickets.SelectedIndex = -1 Then MessageBox.Show("You must select a ticket to view") Else strSelTicket = lstTickets.Items(lstTickets.SelectedIndex).Text and see if that helps.
  4. It would be interesting to see what the auto-generated column headers for your ID fields are. AFAIK, the ColumnMapping property shouldn't include the table name. However, You would end up with three identical 'ID' fields in your datatable. I'm guessing that these will be called something like ID, ID1 and ID2. you will need to set the ColumnMapping property to exactly how these are displayed in your grid currently. B.
  5. Yes, You'll have to create a tablestyle, add relevant columns with tablemappings for the fields that you want, then add the tablestyle to your grid. something like: (vb code) Dim ts as new DataGridTableStyle dim col1 as New DataGridTextBoxColumn col1.MappingName="FIRSTCOL" col1.HeaderText="First Column" ts.GridTableStyles.Add(col1) dim col2 as new DataGridTextBoxcolumn col2.MappingName="SECONDCOL" col2.HeaderText = "Second Column" ts.GridTableStyles.Add(col2) '(repeat blocks as necessary) myGrid.TableStyles.Clear() myGrid.TableStyles.Add(ts)
  6. The beauty of having the .Net Framework, is that the download will have to be performed once, and then multiple programs can use it. It's the whole ethos of shared libraries. That being said, I'm not aware of the ability to install individual parts of the framework - when other programs come to use it, it will only be partially installed and therefore could cause other programs to not function correctly. A lot of newer programs are coming with the framework already (The HP printer software suite includes it as default, for example) so chance are, if they have a new piece of hardware or software, they might already have the framework installed without knowing it. Best you can do is provide it on your CD, or point them to a link to download it. B.
  7. Erm, just a quickie, but how can a number be <99 AND >201 ? Exactly what criteria are you trying to achieve? You're probably looking to use an OR, not an AND (for numbers <99 OR numbers >201) However, you might actually be wanting to use an AND (for numbers >99 AND <201) So, can you be a little more specific, and we can help you more! B.
  8. If the ascii data is in a relatively simple format of CSV or Tab Delimited, then you may be able to make use of the ODBC driver, and fill a datatable with it. I doubt if it will actually result in much of an ACTUAL improved speed, but it might make it more manageable to thread it, so that it is perceived to be faster. I've worked on importing and exporting CSV/TAB files a bit recently, and I've found the ODBC driver is the most flexible to work with. Of course, if your data is in true binary form, then it probably wont work for you. B.
  9. After doing the databinding (using yourgrid.DataSource = mydataset) do something along the lines of the following: dim GridStyle as new DataGridTableStyle dim col1 as new DataGridTextBoxColumn col1.MappingName = "ID" col1.HeaderText = "ID" col1.Width = 10 GridStyle.GridColumnStyles.Add(col1) .. repeat above 5 lines changing col1 each time for every column ... then: mygrid.TableStyles.Clear() myGrid.TableStyles.Add(GridStyle) B.
×
×
  • Create New...