TnTinMN 418 Practically a Master Poster

The Access violation is probably due to you running VB6 as a standard user. Try running it as an Administrator. VB6 is an old program designed when nearly everyone ran with full privileges.

I get the same thing on my XP machine running under a normal account. VBA under Excel 2007 does the same irritating thing as well, except that it does not crash; it refuses to let me add controls.

TnTinMN 418 Practically a Master Poster

^^
That maybe so, but you are basically infering their lack of knowledge.

TnTinMN 418 Practically a Master Poster

^^^^ Cheater

TnTinMN 418 Practically a Master Poster

I guess mileage will vary. I ran you code under VS2008 on a 32-bit XP and Vista and got similar results. Note that my Vista laptop is way under powered. The XP machine has 2 GB Ram were-as the Vista machine has 3-GB ram. Compiled Any-CPU, Release build.

The interesting thing is that I would have thought that the relative ratio between the same test on different machines would have been close. But this is not the case. Perhaps a function of memory?

XP:

        Using CHARACTER ARRAY
        ------------------------------
        Time for new String: 47ms
        Time for concat: 9ms
        Time for stringbuilder: 85ms

        Using IEnumerable<Char>
        ------------------------------
        Time for new String: 1349ms
        Time for concat: 2ms
        Time for stringbuilder: 51ms

        Using List<Char>
        ------------------------------
        Time for new String: 117ms
        Time for concat: 11ms
        Time for stringbuilder: 3ms

Vista:

    Using CHARACTER ARRAY
    ------------------------------
    Time for new String: 318ms
    Time for concat: 111ms
    Time for stringbuilder: 178ms

    Using IEnumerable<Char>
    ------------------------------
    Time for new String: 2691ms
    Time for concat: 15ms
    Time for stringbuilder: 154ms

    Using List<Char>
    ------------------------------
    Time for new String: 307ms
    Time for concat: 130ms
    Time for stringbuilder: 23ms
TnTinMN 418 Practically a Master Poster

Most likely your query is failing to retrieve any rows.

strSelect = "SELECT * FROM dbo.hrEmployeeInformation WHERE eiEmployeeID = '" & dhcboEmployeeSelect.Text & "'"

Is "eiEmployeeID" stored as text or is it a number? If it is a number, remove the single quote (') from the the Select statement.

TnTinMN 418 Practically a Master Poster

Pass a reference to the RTB in in custom menu item's constructor or add a RTB property to it.

Private RTB as RichTextBox
Public Sub New(RTB as RichtextBox)
    Me.New()
    Me.RTB = RTB
End Sub

or

Private _RTB As RichTextBox
Public Property RTB() As RichTextBox
    Get
        return _RTB
    End Get
    Set (value as RTB)
        _RTB = Value
    End Get
End Property

Then use RTB as your reference in your code

TnTinMN 418 Practically a Master Poster

E! (try and find a company that starts with !) :) ha ha

TnTinMN 418 Practically a Master Poster

If you can live with the 28 digit accuracy of the decimal type for the result of the exponentiation, then you can implement your own power function.

    private void test()
    {
        Int32 v = 11;
        Int32 d = 23;
        Int32 n = 187;

        decimal exp = DecPower(v, d);

        decimal m = decimal.Remainder(exp, n);
        string msg = m.ToString();

    }

    private decimal DecPower(decimal Num, Int32 power)
    {
        decimal ret = 1;
        for (Int32 i = 1; i <= power; i++)
        {
            ret = decimal.Multiply(ret, Num);
        }
        return ret;
    }
TnTinMN 418 Practically a Master Poster

I think this thread is endangered (that is the word your should have used instead of Extinct).

Posts: 4 (including this one)

How to save: Beg a moderator to change the title so more people will play.

TnTinMN 418 Practically a Master Poster

I don't care who wins. Look to the left.

TnTinMN 418 Practically a Master Poster

I think that the easiest thing for you to do would be design your Panel as a user control, since that sounds like what you are attempting to do anyways. Doing so, will give you the security of working in the IDE.

Go to the Project Menu and select "Add User Control". Design as you want and then execute a Build on the project. After that the user control should show up at the top of your ToolBox under the Tab "Your Applicatiopn Name - Components". Add it to your form like any other control. Just remember that if you need to change its design, first close your form that houses it, then edit the User Control and rebuild before opening the form up.

TnTinMN 418 Practically a Master Poster

Give this a try and see if it is what you expect.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.BackColor = Color.DarkBlue
        Me.ForeColor = Color.White
        '
        'This creates the Panel

        '*** changed label to panel like you have stated
        Dim pnlOrderEntry As Panel = New Panel
        pnlOrderEntry.Location = New Point(12, 48)
        pnlOrderEntry.Size = New Size(1232, 126)
        pnlOrderEntry.Visible = True
        '*** added this color just so that I could see it, In you don't set a property,
        ' it inherits it from it's Parent control
        pnlOrderEntry.BackColor = Color.Coral
        Me.Controls.Add(pnlOrderEntry)


         '*** add the remaining controls to the panel
        '
        'This creates the label "Part No."
        Dim lblPrtNo As Label = New Label
        lblPrtNo.Name = "lblPrtNo"
        lblPrtNo.Text = "Part Number"
        lblPrtNo.BackColor = Color.DarkBlue
        lblPrtNo.ForeColor = Color.White
        lblPrtNo.Font = New System.Drawing.Font("Sans Serif", 9)
        lblPrtNo.Font = New System.Drawing.Font(lblPrtNo.Font, FontStyle.Regular)
        lblPrtNo.Location = New Point(15, 9)
        lblPrtNo.Size = New Size(77, 15)
        lblPrtNo.Enabled = False
        lblPrtNo.Visible = True
        pnlOrderEntry.Controls.Add(lblPrtNo)
        '
        'This generates the textbox for the user to enter the Part No.
        Dim txbPartNo As TextBox = New TextBox
        txbPartNo.Name = "txbPartNo"
        txbPartNo.Text = ""
        txbPartNo.ForeColor = Color.Black
        txbPartNo.BackColor = Color.White
        txbPartNo.Font = New System.Drawing.Font("Sans Serif", 10)
        txbPartNo.Font = New System.Drawing.Font(txbPartNo.Font, FontStyle.Bold)
        txbPartNo.Location = New Point(15, 26)
        txbPartNo.Size = New Size(263, 22)
        txbPartNo.Cursor = Cursors.Hand
        txbPartNo.AcceptsReturn = True
        txbPartNo.AcceptsTab = True
        txbPartNo.TabIndex = 10
        txbPartNo.Enabled = True
        txbPartNo.Visible = True
        AddHandler txbPartNo.TextChanged, AddressOf txbPartNo_Textchanged
        pnlOrderEntry.Controls.Add(txbPartNo)
    End Sub

    Private Sub txbPartNo_Textchanged(ByVal sender As System.Object, ByVal e As EventArgs)
        Dim txbPartNo …
TnTinMN 418 Practically a Master Poster

Beef. It makes tasty veggy soup. :)

Who is Your favorite author?

TnTinMN 418 Practically a Master Poster

Actually!!

Watch a so-called news broadcast in the US with one of their airhead reporters and count how how many times they use use the word; ACTUALLY. .

ex. We are actually on the scene of an major accident. The police have actually asked the public to stay away. We actually got ill when we seen all hurt people. At Ten o'clock we will actually interview one of the victums.
.................

I actually really hate it's overuse. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually. Actually.

Uhgggg!!!!!!!!!!!!!

Close second: Really.

TnTinMN 418 Practically a Master Poster

Friend just makes them accessible throughout the current assembly (similar to Public, but not accessible outside the defining assembly). If the control does not need to be accessed outside of the control in which it is declared, then Private is fine. Friend is the VB default for autogenerated code; nothing magic about the access level, just what the VB team selected. In C#, the default is private.

The WithEvents statement just allows you to add the "Handles cntrl.Event" to an event handler method for the control. If you do not use WithEvents, you need to use the Addhandler statement to attach a event handler method.

TnTinMN 418 Practically a Master Poster

Since you are making a calculator, I am going to assume that you what to mimic the behaviour of most calculators in that when you type in a number that the most significant digit shifts to the left while the entire number is aligned on the right side of the box. This can be accomplished by setting the Alignment Property to "1-Right Justify".

TnTinMN 418 Practically a Master Poster

Are you refering to the old DEC VT102 computer terminal?

If so, just type: "vt102 escape codes" into your faorite search engine. There is lots of info out there.

TnTinMN 418 Practically a Master Poster

This is your problem

Private Sub GetWord()
    Dim strWordList() As String = Split(My.Computer.FileSystem.ReadAllText("Words.txt"), vbCr)
    Dim randomGenerator As New Random
    intLine = randomGenerator.Next(0, 64144)
    strWord = strWordList(intLine).ToUpper
End Sub

You are splitting on VbCr. It should be VbCrLf

Or try:

Private Sub GetWord()
    Dim strWordList() As String = IO.File.ReadAllLines("Words.txt")
    Dim randomGenerator As New Random

    intLine = randomGenerator.Next(0, 64144)
    strWord = strWordList(intLine).ToUpper

End Sub

Also, instead of the loop: lblDisplayWord.Text = New String("-"c, strWord.Length)

TnTinMN 418 Practically a Master Poster

So, if I understand correctly. You want to share your project definition and source code with your friend as opposed to sending your friend an installable version of your project.

Use the file Explorer and go to your "Visual Studio 20XX\Projects" folder. Right-click on the folder that holds your project. Select Send To --> Compressed (zipped) Folder. You may need to go to the Debug and/or Release folders in the project and delete the .exe (executable) files. Some email providers will not allow your to send exe files even if zipped. This is good practice anyways, as you do not want to accidently infect your friends computer if your's has an undetected virus that has attach itself to your project exe's.

Then when your friend receives it. He/she should extract the folder( Right-Click - Extract All) before trying to work with the files.

Edit:
Oops: I dd not refresh the browser page and see that this was marked solved already.

TnTinMN 418 Practically a Master Poster
TnTinMN 418 Practically a Master Poster

Here is another way.

Private Declare Function AssocQueryString Lib "shlwapi.dll" Alias "AssocQueryStringA" _
    (ByVal flags As AssocF, _
     ByVal str As AssocStr, _
     ByVal pszAssoc As String, _
     ByVal pszExtra As String, _
     ByVal pszOut As String, _
     ByRef pcchOut As Long) As Long

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
    ByVal hWnd As Long, _
    ByVal lpOperation As String, _
    ByVal lpFile As String, _
    ByVal lpParameters As String, _
    ByVal lpDirectory As String, _
    ByVal nShowCmd As Integer) As Long

Enum AssocF
    Init_NoRemapCLSID = &H1
    Init_ByExeName = &H2
    Open_ByExeName = &H2
    Init_DefaultToStar = &H4
    Init_DefaultToFolder = &H8
    NoUserSettings = &H10
    notruncate = &H20
    Verify = &H40
    RemapRunDll = &H80
    NoFixUps = &H100
    IgnoreBaseClass = &H200
End Enum

Enum AssocStr
    Command = 1
    Executable
    FriendlyDocName
    FriendlyAppName
    NoOpen
    ShellNewValue
    DDECommand
    DDEIfExec
    DDEApplication
    DDETopic
    INFOTIP
    QUICKTIP
    TILEINFO
    CONTENTTYPE
    DEFAULTICON
    SHELLEXTENSION
    DROPTARGET
    DELEGATEEXECUTE
    SUPPORTED_URI_PROTOCOLS
    Max
End Enum

Private Const S_OK As Long = &H0
Private Const MAX_PATH As Long = 260
  Public Function GetAsscociatedExe(ByVal doctype As String) As String
    ' Allocate the output buffer

    GetAsscociatedExe = String$(MAX_PATH, " ")
    Dim pcchOut As Long  ' size of output buffer
    pcchOut = MAX_PATH

    ' Get the full pathname to the program in pszOut
    Dim result As Long
    result = AssocQueryString(AssocF.Verify, _
                              AssocStr.Executable, _
                              doctype, _
                              "open", _
                              GetAsscociatedExe, _
                              pcchOut)


    If result <> 0 Then
        GetAsscociatedExe = vbNullString
    Else
        GetAsscociatedExe = Left$(GetAsscociatedExe, pcchOut - 1)
    End If

  End Function


Sub test()

    ' method 1: get associate file
    Dim exten As String …
TnTinMN 418 Practically a Master Poster

I could be wrong, but is'nt "Persist Security Info" a parameter for connecting to SQL Server and not an old Access mdb file?

TnTinMN 418 Practically a Master Poster

I have just seen a resurrected thread about issues with loading images to a PictureBox and the inability to delete the file while the program is running. There was no clear explaination of the problem, only suggested hacks and apparent frustration.

So I thought I would offer this explanation from Microsoft:

SYMPTOMS
When either a Bitmap object or an Image object is constructed from a file, the file remains locked for the lifetime of the object. As a result, you cannot change an image and save it back to the same file where it originated.

Additionally, if the stream was destroyed during the life of the Bitmap object, you cannot successfully access an image that was based on a stream. For example, the Graphics.DrawImage() function may not succeed after the stream has been destroyed.

CAUSE
GDI+, and therefore the System.Drawing namespace, may defer the decoding of raw image bits until the bits are required by the image. Additionally, even after the image has been decoded, GDI+ may determine that it is more efficient to discard the memory for a large Bitmap and to re-decode later. Therefore, GDI+ must have access to the source bits for the image for the life of the Bitmap or the Image object.

To retain access to the source bits, GDI+ locks any source file, and forces the application to maintain the life of any source stream, for the life of the Bitmap or the Image object.

To make a …

TnTinMN 418 Practically a Master Poster

Thanks for the update. Good to know that it is paying off.

If you can not find or create a suitable interface for the iisObject, move that code to its own class or module in a separate file and set the options for that file as needed.

I've seen people use WSH before for that and could never figure out their logic for doing so when the language supports equivalent functionality. Marshalling values across the interop boundary is time consuming and in this case just a waste of time.

TnTinMN 418 Practically a Master Poster

I got some funky behavior as well. Had two controls on the form and one of then tended to disappear.

I think it was related to you setting the FlatStyle in OnPaint. Changing styles tends to trigger a paint event on most controls.

I modified it as follows and all worked great.

//default constructor
    public BinarycheckBox() 
    {
     base.FlatStyle  =  FlatStyle.Flat; //needed
    }

    [System.ComponentModel.DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public new System.Windows.Forms.FlatStyle FlatStyle
    {
        get { return base.FlatStyle; }
        set { }
    }

    //we only need to override the OnPaint method 
    //we do our own painting here
    protected override void OnPaint(PaintEventArgs pevent)
    {
        base.OnPaint(pevent);   //needed
ddanbe commented: Looks great! I fact it was with FlatStyle I had troubles with! +14
TnTinMN 418 Practically a Master Poster

use a RichTextBox instead. It supports Redo.

TnTinMN 418 Practically a Master Poster

apology for not translate well, I speak Spanish

No need to apologize! I only pointed that out hoping that people may be a little bit more understanding. Sometimes it helps for you to post your question in your native language followed by an English translation. But please always include an English translation.

Does any of what we have shown, help?

TnTinMN 418 Practically a Master Poster

I think the OP is using a translator service to post in english and something was lost in the translation.

This is my understanding of your goals:

  1. There is a CheckBox that enables/disables a Delete Button.
    2a. Clicking the button will delete the selected rows from the DataGridView
    or
    2b. Clicking the button will delete row that has focus.

    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Button1.Enabled = CheckBox1.Checked
    End Sub

    ' ***************************
    ' Enable one of these button handlers. Not both

      'Private Sub Button1_ClickV1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      '   ' deletes all seleted rows
      '   For i As Int32 = DataGridView1.SelectedRows.Count - 1 To 0 Step -1
      '      DataGridView1.Rows.Remove(DataGridView1.SelectedRows(i))
      '   Next
      'End Sub
    
      'Private Sub Button1_ClickV2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      '   ' deletes the current row
      '   If DataGridView1.CurrentRow IsNot Nothing AndAlso (Not DataGridView1.CurrentRow.IsNewRow) Then DataGridView1.Rows.RemoveAt(DataGridView1.CurrentCell.RowIndex)
      'End Sub
    

    ' ***************************

      Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
         Button1.Enabled = CheckBox1.Checked
      End Sub
    

    End Class

TnTinMN 418 Practically a Master Poster

Hi ddanbe,

Fun little program. It reminded me how much fun I had drawing geometric shapes back in the dinosaur days when PC's were a curiousity to most.
It inspired me to see how much I have forgotten. :) It took a while but is finally gelled in my mind I was back in the groove with polar to cartesian transformations. If your interested, here is my attempt. It will draw multipointed stars.

TnTinMN 418 Practically a Master Poster

Before you put this on it's own thread, I would suggest that you consider optimizing the code first. You are doing a lot of string manipulations that may be better handled in a stringbuilder instead.

  for (int i = 0; i < gridView1.RowCount ; i++) //getting data that is going to be checked
{
cui = dt.Rows[i]["cui"].ToString().Trim();
cui = cui.Replace("R", "");
cui = cui.Replace("O", "");
cui = cui.Replace(" ", "");

change to:

System.Text.StringBuilder sb = new System.Text.StringBuilder(100);  // adjust initial size base on your anticipated string length
 for (int i = 0; i < gridView1.RowCount ; i++) //getting data that is going to be checked
{
sb.Length = 0; // resets stringbuilder text
sb.Append(dt.Rows[i]["cui"].ToString()); // no need to trim as you are removing all " " anyways
sb.Replace("R", "");
sb.Replace("O", "");
sb.Replace(" ", "");

// now replace all further references to: cui
// with:  sb.ToString()

This appears to dead code left over from debug/development. Concatenating strings like this is very slow, I see a word[31] so at least 32 times this this loops. Comment it out or remove.

 foreach (string word in words)
{
if (word != "")
mesaj = mesaj + " " + word.Trim() + Environment.NewLine;
}
TnTinMN 418 Practically a Master Poster

..Just as TnTinMn says, i would like to print the text from the report but since the information is coming from a stored data in the database, it involves tables. Can i send the project to any of you so you can check and help insert the printing code?

I am confused now.

Do want to create a text based report say like you would in a word processor and print? Or are you using the Microsoft Reports (i.e. you created a .rdlc file) and you do not know how to print it?

If it is the second case, see:

Manually Printing a Report

TnTinMN 418 Practically a Master Poster

Essentially you want some form of panel manager. We discussed a couple of ways of using the TabControl to achieve this in this thread:

http://www.daniweb.com/software-development/csharp/threads/446066/windows-form-designe-change-

TnTinMN 418 Practically a Master Poster

...now when the Form2 is show and everytime i click a button the Form2 lost its focus

I have to ask, which Form parents the buttons that you are clicking? If they are on Form1, this is normal as they have to be in focus to be clicked.

Also, does the combobox handler code you posted have any relavence?
Is it on Form1 or Form2?

TnTinMN 418 Practically a Master Poster

Printing a report is kind of vague.

What do you want in the report? Is it just text or do you want to do tables and images, or something else?

TnTinMN 418 Practically a Master Poster

Or is it just a very bad choice for a rule name? Perhaps "one-dot rule" is zero-relative ;-P

You got-it. :)

I never understood the name very well myself, but that's what I've seen it called by many or the no-double dot rule as well. That's why I just decide to rename it it the above post. :) Possibly the original coiner of the phrase meant that there should be only One-Dot between the ComObject and a point of reference? I guess that makes sense.

Essentially anything that you reference in the a.b.c sequence that returns a ComObject should be set to its own variable so you can break the link to your application by setting the variable to Nothing.

exWB.Sheets(1).Range("a1").Value = "TEST"

In this, both sheets(1) and range("a1") return a ComObject. I just realized I FUBAR'd my original response to the OP. It should have been,

    Set ex = CreateObject("Excel.Application")
    Set exWB = ex.Workbooks.Add
    ' in the next line you have created a inaccessible ComObject (Sheets(1))
    'exWB.Sheets(1).Range("a1").Value = "TEST"
    ' change to
    Set sheet1 = exWB.Sheet(1)
    Set rng=sheet1.Range("a1")
    rng.Value = "TEST"
    Set rng = Nothing
    Set sheet1 = Nothing

Hopefully, I have not confused you and the OP further.

I know that I have not been the most coherent lately. Too many late nights working on my pet projects.:> Also, my frustation level has been high lately dealing with a bad mouse; at first I thought my machine had picked up a virus, or …

TnTinMN 418 Practically a Master Poster

When referencing the ComObjects(application, workbook, range, etc), follow the No Double ComObject rule (also referred to as the One-Dot rule):

DeclaredRef.Comobject.PropertOrMethod

not:

DeclaredRef.ComObject.ComObject.Property

You did a good job referencing and releasing most of them, but missed one.

try changing as follows:

Set ex = CreateObject("Excel.Application")
Set exWB = ex.Workbooks.Add
' in the next line you have created a inaccessible ComObject (Sheets(1))
'exWB.Sheets(1).Range("a1").Value = "TEST"
' change to
Set sheet1 = exWB.Sheet(1)
sheet1.Range("a1").Value = "TEST"
Set sheet1 = Nothing
TnTinMN 418 Practically a Master Poster

Your error is telling you that you do not have the Ace Provider installed.

If you read what I directed you to, you would have seen that the engine installs this provider. Make sure you install the proper version (32/64- bit for your system and application.

TnTinMN 418 Practically a Master Poster

I do have the ability/habit of picking up the accents of people I am listen to though.

@Nuster

I also have that affliction and it can be quite embarrassing at times. Once I was the butt of the jokes at the office after sending two hours on the phone with a guy from Scotland with a very heavy accent. I think in listening to their speech that I subconsciously pick their cadence through a positive re-enforcement feedback loop. The more that I sound like them, the more they understand me and we get more accomplished.

I think that the worst was when I was listening to German Language tapes the night before I went in for a dentist appointment and the receptionist ask me how long I had been in the US since I spoke English so well (I have a Germanic surname).

I just wish I could absorb languages like I do the accents of others speaking non-native English.

That stated, English only please.

TnTinMN 418 Practically a Master Poster
TnTinMN 418 Practically a Master Poster

Did you use "Add DataSource" and click yes to copy local?

This copies the DB to your project folder. The default is to then copy from your project folder to the output (Debug) folder on the building the project. Your program is working on that copy in the output folder, but you are viewing the original in you project folder.

If you wish to stop this behavior, go to the properties on the DB and select "Copy to Output Directory - Do not copy".

TnTinMN 418 Practically a Master Poster

Based on the documentation (Using the Winsock Control) I'd say that you are not performing the Bind properly. You need to specify the local port.

TnTinMN 418 Practically a Master Poster

I suggest that you consider a select case block instead. It will be easier to maintain and read.

Select...Case Statement (Visual Basic)

TnTinMN 418 Practically a Master Poster

There still here. Just a bit different syntax.

How to use ADO Recordsets in Visual Basic .NET

But you may find it usefull to use the .Net wrappers.

Energize Your Data Retrieval Code with ADO.NET Objects

Overview of ADO.NET

TnTinMN 418 Practically a Master Poster
tux4life commented: Exactly! That is what the OP should have Googled himself in fact. +13
TnTinMN 418 Practically a Master Poster

The browser you are using is siliently downloading stuff all the time. It is a matter of do you trust the program.

I use a third party Firewall to block everything unless I grant it permission. However, once you grant a program access to the internet, there is very little you can do about controlling what it downloads. That is where a good anti-virus program comes in that scans internet traffic for the obvious stuff.

Granted, polite programs ask for permission. i.e. Check for Updates, download updates automatically, etc.

To the OP: see: http://www.daniweb.com/software-development/vbnet/threads/441772/silent-browser-download

Edit: I forgot I was in the VB6 forum not VB.Net. Not used to seeing AD or Jim here and I got confused.

Instead see: http://www.ex-designz.net/apidetail.asp?api_id=498 for using URLDownloadToFile.

TnTinMN 418 Practically a Master Poster

Funny. Down there you seem to get more major snowfalls than we do here. We very seldom get the "shut down the city" snowstorms that we see hammering other regions.

I think it's all about available moisture. The farther north you go in the central part of the continent, the less chance that you will get the moisture from the Gulf of Mexico. Its amazing what a mear 100 miles distance can mean. Past dozen or so years, 100 miles south of my location seems to get all the real good precipitaion. I think you get most or your moisture from the Pacific, but I could be wrong.

TnTinMN 418 Practically a Master Poster

PS: i need to save the data of each line in the Db to a single line in the txt file without space between the data.

I don't understand why you do not what a delimiter between the data as it will be nearly impossible to parse later. But you can always change your mind.

Perhaps a more old fashioned approach will be easier for you to understand.

  Dim lines As New List(Of String)
  For Each row As DataRow In dt.Rows
     Dim line As String = String.Empty
     For Each o As Object In row.ItemArray
        line &= o.ToString
     Next
     lines.Add(line)
  Next
  System.IO.File.WriteAllLines("c:\csnet\p.txt", lines.ToArray)
TnTinMN 418 Practically a Master Poster

Started off raining and about 30F and windy. Changed to freezing rain and put about a 1/4 inch of ice on everything and about 1/2 hour ago turned to this.

Yep, 1 to 2-inch snow flakes. Yippie!!!.

Reverend Jim commented: Looks like a nice place to x-country ski. +0
TnTinMN 418 Practically a Master Poster

But since the Alt key doesn't have Ascii equivalent, I can't figure it out. I would want to try Keyup or Keydown but want to have some idea first.

How about using the Shift parameter of the KeyDown Event?

Shift - Indicates the state of the SHIFT, CTRL, and ALT keys.

http://msdn.microsoft.com/en-us/library/aa733630%28v=VS.60%29.aspx

TnTinMN 418 Practically a Master Poster

Extinct Animal: Sabre Tooth Tiger
Population: 0 (the definition of extinct)
How to save them: You can't. They are extinct.