Search results for query: *

  1. D

    save data that is entered

    I do and can not know if this code is correct for your purpose. I have no idea what the content of these textboxes is. If TextBox1.Text contains the name of your table and TextBox2.Text contains the name of the primary key or another identifying column in that table, then: yes this is correct...
  2. D

    save data that is entered

    Yes, it is. Const DeleteSQL As String = "DELETE FROM {0} WHERE {1} = @PK" cmd.CommandText = String.Format(DeleteSQL, tableName, pkName) ' ... But this is rarely really necessary. You could also define several Const strings (one for each table) for the delete statements. Const...
  3. D

    save data that is entered

    Something along the lines of: cmd.CommandText ="DELETE FROM Liquor WHERE [Product Id] = @Id" cmd.Parameters.AddWithValue("Id", productId ) cmd.ExecuteNonQuery where productId is the [Product Id] you want to remove. Do not concatenate your SQL strings, always use Parameter objects .
  4. D

    save data that is entered

    Are you sure you are looking in the right database? The database where your insert is executed is in the bin/debug or bin/release directory. Furthermore: if you added the database file to your project, check the property "Copy to Output Directory". If it says "Copy Always", the database in the...
  5. D

    Question null reference exception unhandled problem

    Combobox2.SelectedValue is Nothing. Use TextBox4.Text = String.Format("{0}", Combobox2.SelectedValue) or test for Nothing If Combobox2.SelectedValue IsNot Nothing Then TextBox4.Text = Combobox2.SelectedValue.ToString Else TextBox4.Clear End If Also: do yourself a favour and give your...
  6. D

    designer can't find custom controls

    With file, do you mean assembly (.dll) or just code file? If they're in the same assembly: always put your custom and usercontrols in a separate assembly . You are probably running a previous version of your program?
  7. D

    Can't create new DLL?

    Did you remove the reference to the old assembly from your project and did you add a reference to the new assembly in your project?
  8. D

    Limiting Combox Display

    Your variable heatInput is always 0: you declare it, and never give it a value.
  9. D

    add assembly language

    That is not the problem here. The problem seems to be that you have some assembler code and you seem to have no clue about what it does. Says who? No, trying to assign the value 181 (decimal) or B5 (hexadecimal) to a System.SByte, will result in a System.OverflowException. Take a step back...
  10. D

    add assembly language

    So actually you have no idea what your assembler code does? Where did you get that code? I think it is the equivalent of this Delphi code beginStartPositie := ZoekStartPositie + 181; Is that possible? Also: .NET has several encryption libraries. Why not use one of those?
  11. D

    Array.Sort method places each lowercas letter before the uppercase.

    Try Array.Sort(stary, StringComparer.CurrentCulture) With my current culture this returns aAbBcCdD (still not what you wanted). What CultureInfo is your CurrentCulture?
  12. D

    Question dropdownlist problem

    Use System.IO.Directory.GetDirectories to get the folders as an array of strings, or System.IO.Directory.GetFileSystemeEntries to get both files and folders as an array of string. Or use one of the System.IO.DirectoryInfo methods: EnumerateDirectories Method...
  13. D

    Web Page Snapshots

    If the url is the direct url for the image, there's no need to launch a browser. Just download the image into a memory stream.
  14. D

    Question Database Path Error

    Why don't you use the |DataDirectory| substitution string? (If needed you can even set this value from AppDomain.SetData).
  15. D

    Question dropdownlist problem

    What happens if you set a breakpoint in the event handler for the first dropdown? Does the eventhandler execute? If it does you probably selected a folder with no files in it. Can you show your relevant code and relevant markup?
  16. D

    Need to open text file of first name and grab name at random

    Only if you don't know the location of the file. Load the lines in a List(Of String) with a StreamReader and your algorithm is as simple as: aRandomInstance.Next(list.Count) If you need to repeat the random picking of a name, you could shuffle the list once.
  17. D

    Question dropdownlist problem

    Did you set the AutoPostBack property of the first dropdown to True? If not, the DropDown.SelectedIndexChanged event does not fire. Also be sure the selected folders has files, otherwise the second DropDownList stays empty. Did you set a breakpoint in both event handlers to verify if they are...
  18. D

    Preserve DataGridView Columns

    How do you "Open" and "Close" your form?
  19. D

    Question dropdownlist problem

    I myself would prefer to go the Ajax route. Nevertheless, following example should demonstrate in plain no-ajax WebForms mode how to get the files displayed in the dropdown: Note: the DropDownFolders dropdown has it's AutoPostback property = True, which is not necessarily a good idea and a...
  20. D

    Question How do I add a newly created textbox to a dynamic Textbox array

    With a List(Of TextBox): Public Class FormListAddresses Private boxList As New List(Of TextBox) Sub AddRow() Dim count As Int32 = 1 + boxList.Count \ 3 Dim current As New AddressControl current.Top = count * current.Height...
Back
Top