Search results for query: *

  1. D

    Question Inserting and updating together

    Here is an idea: check out the RowState property of the DataGridViewRow. You could use that to determine whether you need to update or insert.
  2. D

    Question Creating a textbox list using textboxes as input

    What is happening is that you have not cleared the 'tbxHistory' before you are adding to it again. You don't need to clear the list, but you need to clear the textbox just before you loop through the list again. Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As...
  3. D

    pass a variable from within a class

    My general rule of thumb is to make things as generic as possible to start with and then work towards specifics. This is why I suggested the general list of Damages, you can add as many as you like to a car or as few and no changes need to done to the Car class. If you make the damages/services...
  4. D

    pass a variable from within a class

    I think you need to revisit the requirements. I understand the Car class -- but it seems that you have too many misc. properties for the Car. #Region "SSR Lists & Price Variables" Public SSR_ScratchDamage As List(Of String) = New List(Of String) Public SSR_ScratchPrice As Short = 0...
  5. D

    Linking Comb Box Items to a Button to load a new form

    Give it a try.... did not proof it in visual studio so check for errors. :) Public Sub OpenForm_Click(ByVal sender As Object, ByVal e As EventArgs) Handles openforms.Click Dim formToOpen As Form = Nothing If selectedForm.SelectedIndex = 0 Then formToOpen = new Form3()...
  6. D

    Question Must declare scalar variable error

    Double check your parameter names. Found this one.... No BsAdd.... Just so you know a Scalar Variable is defined within the query itself.
  7. D

    function used to fill a DataTable

    This is a pretty basic function used to fill a DataTable with data from a SQL database but could easily be adjusted for different types of databases. Public Shared Function FillTable(ByVal dtReturn As DataTable, ByVal SelectStatement As String, ByVal ConnectionString As String, Optional ByVal...
  8. D

    Showing a SQL result

    You haven't told the Command object how it is suppose to connect to the database, even though you have a connection object. Personally I prefer the Using statement when doing database work. In your specific code.... cnn = New SqlConnection(connectionString) cnn.Open()...
  9. D

    Showing a SQL result

    Dim oReturnValue As object = myCommand.ExecuteScalar() If oReturnValue IsNot Nothing Then Dim dteReturnValue As DateTime = Convert.ToDateTime(oReturnValue) 'plus all the code to show the payroll date. End If
  10. D

    Question Can make something like this?

    Yes VB.Net can do this. Make a form (ex: SerialChecker), add a TextBox, and probably a couple buttons. Add code the Load, and button events. And next thing you know you have an application.
  11. D

    How to make InputBox text UseSystemPassword?

    You don't. Make a form or use the dialog box template to make one. Then on the new form you can use the Textbox control in Password mode. Dim frmGetPassword as New MyGetPasswordDialog() If frmGetPassword.ShowDialog() == DialogResult.OK Then Dim Password As String =...
  12. D

    Question How do I access a DataTable on another form?

    First you need an instance to reference. When you do songsForm.dtSongs.Rows.Count you are accessing the 'blueprint' for the songsForm not the actual instance of songsForm that has data in it. For instance the blue prints of a house will not tell you the color of Suzie's room, because the...
  13. D

    Question Store the reference passed to a sub

    Your answer is actually in your question. I believe that you will need to make a constructor for your form and pass in the LogPointer value that you need and store as a class level variable. Public Class LogForm Dim LogPointer As String 'constructor for new form Public...
  14. D

    Windows state control in WindowsApplication

    No. 'This will open a new IE application window whether there is already an IE application running or not, and go to the relevant address passed as the argument 'Dim psi As New System.Diagnostics.ProcessStartInfo("iexplore.exe", "http://www.hamilton.co.uk/overview.cfm") 'If...
  15. D

    Windows state control in WindowsApplication

    System.Diagnostics.Process is the way to go in VB.NET. Dim psi As System.Diagnostics.ProcessStartInfo Dim p As System.Diagnostics.Process psi.FileName = "http://www.somewhere.com" psi.WindowStyle = ProcessWindowStyle.Normal p =...
  16. D

    Selectedindex always returns value of -1

    It has to do with the page life cycle. Where you are adding the items to the listbox is a little unusual (imo). What happens is when you first load the page the Page_Load event fires, then the html side loads and that is where your list is populated. When you click the button after making your...
  17. D

    Getting Mouse Position over an Object

    As you create each picture box for the array you need to add the handler to it at that time. Dim pb As New PictureBox AddHandler pb.MouseMove, AddressOf Form1_MouseMove
  18. D

    Insert and show data in DataGrid

    Well what have you written for code so far?
  19. D

    Question Access main form from second thread running in a module

    Well honestly on the form(form1) I would use a Backgroundworker component to do my threading. You can set properties on the Backgroundworker to allow it to update the main thread as well as to allow cancellation. The Backgroundworker has events that can be called to perform your separate work...
  20. D

    Question Embedding one form into another form

    I am pretty sure that you can't "embed" a form into another form, at least not that I have heard of. However I believe what you are looking for is a custom user control. Here are a couple links: One and Two here is an older one
Back
Top