Jump to content
Xtreme .Net Talk

tate

Avatar/Signature
  • Posts

    116
  • Joined

  • Last visited

Everything posted by tate

  1. tate

    Launch Web Page

    Never mind, I finally figured it out. System.Diagnostics.Process.Start
  2. Use the TextChanged event to set the variable. Example; Private Sub rtbViewer_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) 'Set flag when a change has been detected mblnChanged = True lblStatus.Text = mstrFileName & "**" 'Status to indicate change End Sub
  3. Instead of instantiating a form to display instructions on how to use a program within the Help menu I would like to place a web link; mnuHelp_Click launch IE, path somepage.htm Can this be done? This would allow me to provide links to all kinds of other information that is outside of .NET. Thanks in advance.
  4. That did it. Thanks for refreshing my memory.
  5. My memory is slipping me! I believe there is a way to prevent activating another form until the newly instantiated form is closed. I believe it was called modal or somthing like that. For example, a frmAbout is instantiated by a menu click event. The new form loads and is placed on top of the previous form. How do you prevent focus on the previous form until the new form is closed? Thanks for your help.
  6. tate

    ascii

    Do you want to convert a byte string that represents a hex value to ascii?
  7. tate

    msgbox

    Is this for a VB .NET application? If so, what about MessageBox.Show option?
  8. Your question; Does dsFactory refer to the dataset? Yes, dsFactory is the name of the dataset that was generated. Does tblfactory refer to the datasource of this dataset? In this case, yes. However, you can have multiple database tables in a dataset. The key here is to map the datagrid style to a particular table that is later defined as the source for a datagrid control. In what context is 'TableName' used?Is it to tell .NET that is handles a tablename??????? I believe you are correct but I'm not 100% sure of it. If you would like I can send the complete original solution which may allow you to understand better. Just post your email address and I'll send it to you.
  9. Does anyone know of a good resource that will provide insight on how data can be sent and read through a PC's serial port? Thanks
  10. When I need something to practice on and I don't have any immediate need personally I look at where my friends or church may need some help. Since my wife is a teacher I discovered how ancient the tools were that they used to maintain student grades. It was fun to develop the database application and it was really more complicated than you would think.
  11. I have been able to make the update function properly. However, you have to select update after each change. If changes were made to multiple datagrid records and then update was selected only the first datagrid would update properly, all other changes were lost.
  12. Sounds like you need a reference to the parent within you child form. However, need more detail.
  13. What is a treeview? Please add some more detail to your question. A click event of numerous types is associated with the child or parent form in which it took place.
  14. The general steps listed below should give you a good start; Create connection - Drag OleDbConnection tool (Data tab) to form - Connection string property define the new connection string - Provider tab, utilize Microsoft Jet 4.0 OLE DB Provider then Next - Navigate to database file *.mdb Create data adapter - Drag the OleDbDataAdapter tool (Data tab) to form - Select the connection just made above then Next - Make sure SQL statements radio button is chosen then Next - Select Query builder to add associated database table - Select fields from chosen table Generate the dataset - Click Data pull down menu at top of screen, click generate dataset - Enter name of dataset - Choose table(s) to add to the dataset Fill the dataset within Load event Bind data to form control ************* Code Example ************************* Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Fill dataset Dim intRecords As Integer Dim bndTemp As Binding intRecords = odbdaFactory.Fill(dsParts) 'Bind form's text boxes bndTemp = New Binding("Text", _ dsParts, "tblParts.fldPartNumber") txtPartNo.DataBindings.Add(bndTemp) bndTemp = New Binding("Text", dsParts, "tblParts.fldDescription") txtDesc.DataBindings.Add(bndTemp) bndTemp = New Binding("Text", dsParts, "tblParts.fldCost") txtCost.DataBindings.Add(bndTemp) bndTemp = New Binding("Text", dsParts, "tblParts.fldSalesPrice") txtSalesPrice.DataBindings.Add(bndTemp) bndTemp = New Binding("Text", _ dsParts, "tblParts.fldQuantityOnHand") txtQtyOnHand.DataBindings.Add(bndTemp) End Sub
  15. I'm only familiar with programming MS Access .NET applications so I'm confused a little by the SQL stuff. Therefore, I'll just provide an example of a datagrid table that has modified headings, background color, and witdth assignments. ************* Code Example ************************** 'Create a DataGridTableStyle object to customize the data grid 'appearance. 'This object must be present before the GridColumStyle 'object is created which is needed to modify the header text. Dim dgtsFactory As New DataGridTableStyle() 'Rows to have an alternating color dgtsFactory.AlternatingBackColor = Color.Aqua 'Map the DataGridTableStyle to each table dgtsFactory.MappingName = dsFactory.tblFactory.TableName 'Associate the DataGridTableStyle with the data grid dgFactoryName.TableStyles.Add(dgtsFactory) 'Add DataGridColumnStyle object dgtsFactory.GridColumnStyles(0).HeaderText = "Factory ID" dgtsFactory.GridColumnStyles(0).Alignment = _ HorizontalAlignment.Left dgtsFactory.GridColumnStyles(0).Width = 60 dgtsFactory.GridColumnStyles(1).HeaderText = "Factory Name" dgtsFactory.GridColumnStyles(1).Alignment = _ HorizontalAlignment.Left dgtsFactory.GridColumnStyles(2).HeaderText = "Factory Address" dgtsFactory.GridColumnStyles(2).Alignment = _ HorizontalAlignment.Left dgtsFactory.GridColumnStyles(2).Width = 130
  16. I'm quite familiar with how to update a single datagrid so the source database table if updated. dsInsertedRows = dsDataSet.GetChanges(DataRowState.Added) dsModifiedRows = dsDataSet.GetChanges(DataRowState.Modified) dsDeletedRows = dsDataSet.GetChanges(DataRowState.Deleted) If Not dsInsertedRows Is Nothing Then odbdaDataBase.Update(dsInsertedRows) End If If Not dsModifiedRows Is Nothing Then odbdaDataBase.Update(dsModifiedRows) End If If Not dsDeletedRows Is Nothing Then odbdaDataBase.Update(dsDeletedRows) End If dsDataSet.AcceptChanges() However, I'm working on a solution that utilizes a single dataset that contains 3 different database tables (3 data adapters) that are linked by 2 data relations. The data from each table is displayed in a seperate datagrid. My problem is if I use the same type of code as above to update the complete dataset an error is generated when trying to update a data adapter that doesn't have a change. If Not dsModifiedRows Is Nothing Then odbdaDataBaseTable1.Update(dsModifiedRows) odbdaDataBaseTable2.Update(dsModifiedRows) odbdaDataBaseTable3.Update(dsModifiedRows) End If I haven't bee able to figure out a way to capture the changes (GetChanges) for a particular data adapter. Any suggestions? Thanks in advance. [edit]added [vb ] tags [/vb ][/edit]
×
×
  • Create New...