User Profile

Collapse

Profile Sidebar

Collapse
marcellus7
marcellus7
Last Activity: Aug 31 '11, 04:44 PM
Joined: Oct 8 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • A simple way would be exporting it to a tab-delimited text file, and just importing that into excel. Here's some code that will export to tab or csv depending on parameters.

    Code:
       Sub DataTable2Tab(ByVal table As System.Data.DataTable, ByVal filename As String, _
        ByVal sepChar As String)
            Dim writer As System.IO.StreamWriter
            Try
                writer = New System.IO.StreamWriter(filename)
    ...
    See more | Go to post

    Leave a comment:


  • Use an @ before the variable names, so that they will be used as parameters, and when you fill the dataset, pass those variables as parameters
    See more | Go to post

    Leave a comment:


  • Code:
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As _
    System.EventArgs) Handles MyBase.Load
    Me.Cursor = New Cursor("C:\Windows\Cursors\pen_m.cur")
    End Sub
    End Class
    See more | Go to post

    Leave a comment:


  • marcellus7
    replied to Reading a word from text file
    Here's some information on how you'd read it.

    First, you'd read in the file, where inFilename is the path to your text file, using FileStream to access the file, and StreamReader to read the data from the text file:

    Code:
            Dim fs As New IO.FileStream(inFilename, IO.FileMode.Open)
            Dim sr As New IO.StreamReader(fs)
    Next, you'd read the data from the text file into a string array, splitting...
    See more | Go to post
    Last edited by marcellus7; Nov 11 '10, 03:43 PM. Reason: edit code

    Leave a comment:


  • marcellus7
    replied to editing datagridview cells
    An easier way to do this would be to use the BindingSource tool. You can simply set your dataset to the BindingSource, and set your DataGrid datasource to the BindingSource, and it will automatically handle the functions that would allow a user to edit the data in the DataGrid, and you could modify it by just using the properties of the datagrid.
    See more | Go to post

    Leave a comment:


  • Are you trying to run some code in the background so it does not interrupt your user interface when it is loading? If so its best to run that code asynchronously, or on another thread, and the easiest way to do that with basic code would be to add a background worker.

    After adding a background worker, you'd add the function that executes whatever code you are loading in the Backgroundworke r.RunWorkerAsyn c() method, and it will run the...
    See more | Go to post

    Leave a comment:


  • marcellus7
    started a topic Crystal Reports Unbound Numeric Field Set Value
    in .NET

    Crystal Reports Unbound Numeric Field Set Value

    Hey guys, I cant figure this out for anything. I have an unbound numeric field on a crystal report, how can I set the value to the number programmaticall y in .NET? Heres how I set the value to some of the unbound text fields I have in the report.

    Code:
        CType(MainReport.ReportDefinition.ReportObjects.Item("txtBox1"),  _
         CrystalDecisions.CrystalReports.Engine.TextObject).Text = textbox1.text
    ...
    See more | Go to post

  • How are you storing the data thats being displayed in the DataGridView? DataGridViews are usually used only to display information thats being stored in a table somewhere. Can you post the code where you select the data and display it in the datagrid?
    See more | Go to post

    Leave a comment:


  • Sorry I had to re-read your answer to grasp it. The best way to do that is to create a DataView, set the DataView source to the source table that holds the data for your SELECT * FROM Exceptions query, and filter the DataView based on those dates. In this scenario your DataGrid source would be the dataview. Heres an example:

    Code:
    Public Class Form1
    Dim dataTable as New DataTable
    Dim dataView as New DataView
    ...
    See more | Go to post

    Leave a comment:


  • Ok, what you can do then is there is an option in the query wizard, when you create the query in the tableadapter, to use the query to fill a datatable. So declare the datatable in the Form (not in the OnClick event), and in the onclick event run the query to fill the datatable. Then you can just set the DataGrid source to the newly filled datatable.
    See more | Go to post

    Leave a comment:


  • Are you using a tableadapter? That makes it a lot easier. From the tableadapter you can add the query, and when creating the query use an @ to declare parameters. So you'd create teh query like this in the tableadapter:
    Code:
    SELECT name, address
    FROM Users
    WHERE name = @name
    And then you'd call the query from the tableadapter in your code like this:

    Code:
    UsersTableAdapter.NameQuery(Form1.name)
    ...
    See more | Go to post

    Leave a comment:


  • Why couldn't you just run each one, one after another in the onclick event?
    See more | Go to post

    Leave a comment:


  • marcellus7
    started a topic VB .NET IO.FileInfo Path too Long

    VB .NET IO.FileInfo Path too Long

    Is there anyway I can get around a path being too long to get the fileinfo using IO.FileInfo? Im accessing files across a network with this application, and sometimes the paths get really long. Any help would be greatly appreciated!

    Thanks
    See more | Go to post

  • Ok guys, I think I've got it. I didnt know that when you add a dataset to the form using the Designer, it turns on the Generate Member property, which automatically saved the datatable in memory and declares it, etc. If you change this property to false, you can declare your own instance of the datatable, and dispose it as often as necessary to keep memory usage down. Just an FYI incase anyone else runs into this.

    Thanks
    See more | Go to post

    Leave a comment:


  • marcellus7
    started a topic Memory Handling - DataTable and SQL Database
    in .NET

    Memory Handling - DataTable and SQL Database

    Hey guys Im having some problem with handling DataTable memory, here's my predicament; Ive got a TableAdapter and Dataset from a SQL Database that I am inserting records to. These records are being inserting directly to schema using a DataRow of the table from the dataset (I cant use the insert query from the tableadapter because there are over 100 columns in the table that its being inserted to.)

    My problem is that the datatable seems...
    See more | Go to post

  • marcellus7
    replied to SQL Server Join 2 Tables Into One
    Thanks a lot for the response. I was able to get it done by using the Query Editor to do a Select All from one of the tables, then highlight the query, right click, and edit in query designer again, and it generated the list of columns for me.
    See more | Go to post

    Leave a comment:


  • marcellus7
    started a topic SQL Server Join 2 Tables Into One

    SQL Server Join 2 Tables Into One

    Hey guys, im having trouble joining two tables into one. Both have different columns, and a matching id. When I try:

    SELECT *
    INTO FinalTable
    FROM Table 1
    Full Join Table 2
    ON Table1.id = Table2.id

    I get an error saying that both tables contain ID. How could I do this without having to specify every column? Each of these tables has over 100 columns.

    Thanks
    See more | Go to post

  • This is the code in VB .NET, just add a panel to each tabcontrol, and replace childform with the instance of the form you want to display.

    Code:
     	 Panel1.Controls.Clear()
            childForm.FormBorderStyle = FormBorderStyle.None
            childForm.MaximizeBox = False
            childForm.MinimizeBox = False
            childForm.ControlBox = False
            Me.IsMdiContainer = True
            childForm.MdiParent
    ...
    See more | Go to post

    Leave a comment:


  • Thats how you show a message box, but where are you checking for the wrong password?
    See more | Go to post

    Leave a comment:


  • marcellus7
    replied to Change combobox value
    Im not sure I exactly get what you're trying to do, but how about:

    Code:
    MasterBox.SelectedIndex = num - 1
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...