Begginnerdev 256 Junior Poster

If you are receiving the prompt above then you have more problems than that code. ^_^

I do not see the message box which you are talking of.

Is this code snippet the full code? (I am assuming it is because of the class tags)

Begginnerdev 256 Junior Poster

When you issue this select command:

"SELECT * FROM Table WHERE 1=2"

You are just retrieving the table structure simply because 1 will never equal 2.

This is a nifty little trick to get your table structure without having to recreate it in code.

Just makes life a little easier. :)

As for the column headers, just set the start of i to 0 and your problem should be solved. :)

For i = 0 To lstAllStrings.Count - 1 'Skip the title row and the empty row
  lstFinalStrings.Add(lstAllStrings(i).Split(" ").ToList)
Next

Just a note, if the spaces are tabs you can change the split from:

.Split(" ")

To

.Split(vbTab)
Begginnerdev 256 Junior Poster

Your code simply adds 10 (or subtracts) to the label no matter if the user scales the image 10 pixels.

You will have to get the amount the image changed and reflect that change on the label.

As for the label saying the wrong location, do you have code that changes this? Or is this bug due to resize?

Begginnerdev 256 Junior Poster

How about something like engineering a network for a hospital or a school?

How about engineering a network for a rural location using a satalite?

How about engineering a network for secure communications? (Like government)

Begginnerdev 256 Junior Poster

You will want to open a stream reader to the file and pull all lines in from the file. You will then have to remove the spaces from the lines to extract the infromation you want. This can be done like so:

Private Function FillStringList(ByVal sFileName As String) As List(Of List(Of String))
    Dim sr As New StreamReader(sFileName)
    Dim lstAllStrings As New List(Of String)
    Dim lstFinalStrings As New List(Of List(Of String))
    Try
        Do While sr.Peek <> -1
            lstAllStrings.Add(sr.ReadLine())
        Loop

        'Split on spaces
        'Should look something like
        '(0) = 07-24-13
        '(1) = 12:23:52
        '(2) = 001
        '(3) = 07

        For i = 2 To lstAllStrings.Count - 1 'Skip the title row and the empty row
            lstFinalStrings.Add(lstAllStrings(i).Split(" ").ToList)
        Next

        Return lstFinalStrings
    Catch ex As Exception
        MsgBox(ex.ToString)
        Return Nothing
    Finally
        sr.Close()
        sr = Nothing
        lstAllStrings = Nothing
        lstFinalStrings = Nothing
    End Try
End Function


Private Sub InsertToDatabase(ByVal lstStrings As List(Of List(Of String)))
    Dim da As New OleDbDataAdapter(New OleDbCommand("SELECT * FROM Import WHERE 1=2", _
                                   New OleDbConnection("myConnectionSTRINGHERE"))) ' Gets the table structure
    Dim ds As New DataSet

    Try
        da.Fill(ds, "Import")

        If Not IsNothing(ds.Tables("Import")) Then
            For Each item As List(Of String) In lstStrings
                Dim dr As DataRow = ds.Tables("import").Rows.Add()

                dr("Date") = item(0) 'Need fault protection
                dr("Time") = item(1) 'This code sample assumes data will be consistent
                dr("s1") = item(2) 'You will need to put your own handling in
                dr("s2") = item(3) 'This is not guarenteed
                dr("EmpiD") = item(4)
                dr("IN\OUT") = item(5)
            Next

            da.InsertCommand = New OleDbCommandBuilder(da).GetInsertCommand
            da.Update(ds.Tables("Import")) 'Update will issue the insert
        Else
            Exit Sub …
Begginnerdev 256 Junior Poster

You will have to size the lables accordingly.

One idea would be to get the size ratio of the label and using that ratio scale the label when the image is scaled.

You will also have to move the label when the image is moved. One way you might be able to do this is to get the ammount the image has moved (X2 - X1,Y2 - Y1) Then add that to the current location of the label (X,Y).

Begginnerdev 256 Junior Poster

You can look into using LINQtoSQL or some kind of business objects.

LINQ to SQL automatically generates the relationships on object creation. (retrieval)

With a business object model, you will write each object type - giving you complete control over how it acts.

For example:

Public Class Location
    Public Property LocationID
    Public Property LocationName

    Public Sub New()
    End Sub
    Public Sub New(ByVal iID As Integer)
        If Not IsNothing(iID) And iID >= 0 Then
            GetInfo(iID)
        End If
    End Sub

    Public Sub GetInfo(iID)
        'Write code to retrieve information from the database.
    End Sub

    Public Sub Insert()
        'Write code to insert the current instance into the database
    End Sub

    Public Sub Update()
    'Write code to update the current instance in the database
    End Sub

    Public Sub Delete()
    'Write code to delete the current instance from the database.
    End Sub
End Class

Here is a bunch of information on LINQtoSQL.

Hope this helps!

Begginnerdev 256 Junior Poster

IS this post for instructional purpose or do you have a question about the code above?

Begginnerdev 256 Junior Poster

I am sorry to sound harsh, but what are we supposed to be improving?

What part of your code are you having a problem with?

Begginnerdev 256 Junior Poster

If the other application is sending out six bytes, could it be Int32 with a 2byte for a character?

(Shooting in the dark.)

Begginnerdev 256 Junior Poster

You can find the commands to do so here.

The link above is said to be a .bat file.

You can launch a .bat from vb.net like so

Begginnerdev 256 Junior Poster

I would suspect your select/fill code to have a fixed index.

Have you checked to make sure?

Or am I misunderstanding the question?

Begginnerdev 256 Junior Poster

1066Mhz is the speed that ram will send/receive data.

The kit that you are looking at is an 8gb kit. (8192mb kit)

This is the amount that will be added to your memory bank.

Begginnerdev 256 Junior Poster

Here is an oldy but a goody that will get you started on MessageQueues

Begginnerdev 256 Junior Poster

You will need to look into using Word interopt.

Here is an example in C# and VB.Net

Here is an example in C#

A good C# to VB.NET converter can be found here.

Begginnerdev 256 Junior Poster

I wrote some software like this once. I used the width/height of the barcode bitmap and the size of the paper to determin the spacing to get the maximum amount per sheet printed.

I don't have have any source code on hand, but the basic concept was:

1)Get Bitmap

'Call your bitmap code128 function and store the bitmap

2)Calculate Width of Page

'If printing 8.5x11 you will have to know the resolution of the printer(200 in my case)
Dim szPaperInPixels As Size = New Size(8.5 * 200, 11 * 200)

3)Calculate Number of bitmaps (W & L of Page)

Dim iBitmapsWide As Integer = szPaperInPixels.Width / (picBarCode.Width + 10) '5 pixels of space on each side.
Dim iBitmapsHigh As Integer = szPaperInPexels.Height / (picBarCode.Height + 10) ' 5 pixels of space.

4)Copy by looping.

'Place your draw code in the loop with the given information
For i = 1 to iBitmapsHigh 'Length

   'Check to see what row you are on and add padding accoringly
   Dim iPaddingHeight As Integer = 0
   If i > 1 Then iPaddingHeight = ((picBarCode.Height + 5) * i)

   For j = 1 to iBitmapsWide
        Dim iPaddingWidth As Integer = 0
        If j > 1 Then iPaddingWidth = ((picBarCode.Width + 5) * j)         
        'g = Graphics      
        g.DrawImage(picBarCode, New Point(iPaddingWidth + 5, iPaddingHeight + 5))
   Next
Next

Again, I do not have the source code from the original application to verify this.

But the logic is pretty straight forward.

I …

Begginnerdev 256 Junior Poster

WikiBooks is a decent starting point.

Begginnerdev 256 Junior Poster

Here is a link to an application that reads on a pretty low level. (MFT)

This would be quicker, but possibly some unnessesary overhead.

The problem alot of programmers have, including myself, is the habbit of over engineering an application. Sometimes simpler is better.

Begginnerdev 256 Junior Poster

Possible cause is Word automaticly adds a blank page on load.

Is it possible that when you call the Create that is loads word into memory with the assumption of a start with blank page??

Begginnerdev 256 Junior Poster

Here is a forum post in StackOverflow when a user posted information on this very subject!

I hope it helps!

Begginnerdev 256 Junior Poster

You will need to find out what library you wish to use.

For example:

System.Data.SQLClient
System.Data.OleDB
System.Data.* 'Microsoft loves re-inventing the wheel

As for the connection, you need to find the correct connection string to the database. (See here.)

Next you will have to determine which method of manipulation is right for you. (Sounds like one of THOSE commercials.)

You can pull down a copy of the data (Using DataAdapters) or manipulate the data "live" (Using DataReaders)

As for the code to connect, it is as simple as:

Dim con As OleDBConnection("MyConnectionStringHere")
con.Open()
Begginnerdev 256 Junior Poster

Without specifying what sonic is we can not give a very good answer.

When you say Sonic, I am assuming Sonic ESB.

The development documentation can be found here.

Begginnerdev 256 Junior Poster

You will need to look into encryption methods.

I think the industry standard is 256 AES encryption at the moment.

Here is a small project on CodeProject that will get you started.

Begginnerdev 256 Junior Poster

One that that does catch my eye is the:

System.Text.Encoding.UTF8.GetBytes

This is grasping for straws: but I am not sure an image should be encoded in UTF8 text format.

You can try something like a direct cast:

  PictureBox1.Image = Image.FromStream(New MemoryStream(DirectCast(ds.Tables("image").Rows(c - 1)("beeld_data"), Byte)))  

To see if that solves your problem as well.

I hope it helps!

Begginnerdev 256 Junior Poster

It shouldn't really matter, but the function is calling for a stream.

See if this works for you:

     Dim stmBLOBData As New MemoryStream(bytBLOBData)
     Using strm As Stream
         stmBLOBData.CopyTo(strm)
         PictureBox1.Image = Image.FromStream(strm)
     End Using
Begginnerdev 256 Junior Poster

Such a broad question makes it very difficult to give a good answer.

When you are wanting to store the check boxes, are you checking for yes/no values or something like options a new vehicle?

If you are storing yes/no then it is as simple as storning them in bit/tinyint/boolean fields.

An example for SQL Server (using bit and the OleDB library) would be:

Dim iBitVal As Integer = IIf(CheckBox1.Checked,1,0)
Dim cmdUpdate As New OleDBCommand("UPDATE myTable Set bitColumn1=" & iBitVal & " WHERE UniqueField=MyUniqueValue",MyOleDBConnection)
cmd.Update()

If you are storing something such as options on a new vehicle, you will to design your table accordingly. You can store them all in one field using a max length column or you could create a field for each option (only if constant - Very sloppy but some times manditory)

I hope this helps.

Please provide more infromation for a better answer. :)

Begginnerdev 256 Junior Poster

You will need to look into using a setup wizard.

Something like InnoSetup or InstallShield would do what you are wanting.

As for creating the database, you will probably have to write a script or module that can be fired from the setup wizard.

Something like vbscript or a vb module might be what you are looking for.

Begginnerdev 256 Junior Poster

One problem that may occur is if D: is mapped to a network drive and the database is being used by some one else. (D: might not be the same drive for them)

Begginnerdev 256 Junior Poster

Does the DataGridView in the sales form have AutoGenerateColumns enabled while the Purchase does not?

Begginnerdev 256 Junior Poster

Does the local administrator have privelages over the domain, or are there two levels for admin? (Domain and local)

Begginnerdev 256 Junior Poster

If Motor is the name of the class then you might be refrencing an un instantiated object.

For example:

Dim m As New Motor

'm is now instantiated
m.tenLin = 220

MsgBox(m.tenLin) ' Should read out 220

I hope this helps

Begginnerdev 256 Junior Poster

For method one above, something like this may work:

'Class level variable
Dim lviCurrent As ListViewItem

Private Sub ListView1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ListView1.Click
    Try
        If Not IsNothing(Me.ListView1.SelectedItems) Then
            If ListView1.SelectedItems.Count = 1 Then
                lviCurrent = ListView1.SelectedItems(0)
            Else
                'Build in referencing for multiple items?
                Exit Sub
            End If
        End If
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
End Sub

Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click
    Try

        'Your update Code

        If Not IsNothing(lviCurrent) Then ListView1.Items.Remove(lviCurrent)
        lviCurrent = Nothing
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
End Sub

For the second method listed above, you can iterate through each item:

For Each lvi As ListViewItem in ListView1.Items
    'Place your update code here referencing lvi    
Next

ListView1.Items.Clear()
Begginnerdev 256 Junior Poster

That is a video tutorial on how to use the MSSQL Server Import and Export Data wizard that comes with SQL Server. He pulls the application up around 2:50 in the video.

Begginnerdev 256 Junior Poster

You will greatly sacrfice performace by iterating through 20k records.

If you are worried about duplicates, just remove the item saved from the listview. (Keep them from clicking it again)

If you are still wanting to save everything, just iterate through and pull in values you want.

Begginnerdev 256 Junior Poster

After doing a quick view source of google - it looks like what you really want is wrapped inside <cite> </cite> tags, and not href.

Begginnerdev 256 Junior Poster

My untrained eye cannot see any hard coded reference to your external drive.

Is it possible that the application is finding something like a sd card reader and labeling it as a removable media?

Begginnerdev 256 Junior Poster

By seeing this code, I assume that you are using a form of data hiding.

That being said, the code posted works and should not create such a problem by its self.

Run a find all references and see where else the value is getting changed for your string.

Begginnerdev 256 Junior Poster

If user names are unique you can select them from the table.

If your user passwords are not encrypted, and are plain text (I HOPE AND PRAY that this is only a exercise!) Then you can just check the password field.

For example:

Private Function Autherized(ByVal sUser As String, ByVal sPass As String) As Boolean
    Try
        'Get your real connection string @ www.connectionstrings.com
        Dim da As New OleDbDataAdapter("SELECT * FROM tblUsers WHERE User='" & sUser & "'", New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;"))
        Dim ds As New DataSet

        da.Fill(ds, "pw")

        If Not IsNothing(ds.Tables("pw")) And ds.Tables("pw").Rows.Count > 0 Then
            If ds.Tables("pw").Rows(0)("Password") = sPass Then
                Return True
            Else
                Return False
            End If
        Else
            Return False
        End If
    Catch ex As Exception
        MsgBox(ex.ToString)
        Return False
    End Try
End Function

Now just call the function when the user presses the login button:

Private Sub btnLogin_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnLogin.Click
    Try
        If Autherized(txtUser.text,txtPass.Text) Then 'Both are text boxes.
            'Do work for autherized users.
        Else
            MsgBox("You are not autherized to access this application!")
        End If       
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
End Sub
Begginnerdev 256 Junior Poster

After a quick session with Google - I've found this article.

Begginnerdev 256 Junior Poster

Your code looks like it could be reduced by using List(Of String)

Dim myList As List(Of String)

Then you could add elements by valling the .Add function.

myList.Add("Hello,")
myList.Add("World!")

Then to iterate through the list just do a simple for each:

For Each s As String In myList
    MsgBox(s)
Next

This will keep you from having to set size limits for your array. You can scale up as needed.

Begginnerdev 256 Junior Poster

Something like this may work:

if (strpos($str, 'StringHere') !== FALSE)
    echo 'Found it';
else
    echo "nope!";

Answer was found here.

Begginnerdev 256 Junior Poster

You first need a way to refrence the student for the update. An ID column works perfect for this.

You will need to reference the text box values, therefore, need to name the nextboxes something that can be descriptive.

For example:

            For Each DR As DataRow In DT.Rows
                Dim tpNew As New TabPage
                tpNew.Name = DR("StuID") ' Will name the tab after the ID column value

                Dim txtStudentName As New TextBox
                With txtStudentName
                    .Name = "txtStudentName"
                    .Text = DR("STUNameDB")
                    .Size = New Size(76, 12)
                    .Location = New Point(5, 5)
                End With

                Dim txtStudentClass As New TextBox
                With txtStudentClass
                    .Name = "txtStudentClass"
                    .Text = DR("STUClassDB")
                    .Size = New Size(76, 12)
                    .Location = New Point(5, 30)
                End With

                Dim txtStudentAmount As New TextBox
                With txtStudentAmount
                    .Name = "txtStudentAmount"
                    .Text = DR("StuAMTXTDB")
                    .Size = New Size(76, 12)
                    .Location = New Point(5, 42)
                End With

                tpNew.Controls.Add(txtStudentName)
                tpNew.Controls.Add(txtStudentClass)
                tpNew.Controls.Add(txtStudentAmount)
                TabControl1.TabPages.Add(tpNew)
            Next

When you press the save button you will need to call the active tab page:

Dim activePage As TabPage = TabControl1.SelectedTab

Then issue the update:

Dim iStudentID As Integer = CInt(activePage.Name)
Dim txtStudentName As TextBox = TryCast(activePage.Controls("txtStudentName"),TextBox) 
Dim txtStudentClass As TextBox = TryCast(activePage.Controls("txtStudentClass"),TextBox) 
Dim txtStudentAmount As TextBox = TryCast(activePage.Controls("txtStudentAmount"),TextBox)

Dim q as String = "UPDATE StuInfo SET STUNameDB='{0}',STUClassDB='{1},StuAMTXTDB='{2} WHERE StuID={3}"

q = String.Format(q,txtStudentName.Text,txtStudentClass.Text,txtStudentAmount.Text,iStudentID")
cmd.CommandText = q
cmd.ExecuteNonQuery
Begginnerdev 256 Junior Poster

Are you programming in WPF or Winforms?

Begginnerdev 256 Junior Poster

Here is a forum post using the Windows API to get the process and bring it forward.

I hope this gets you on your way.

Begginnerdev 256 Junior Poster

Here is a link to an example which can get you started.

Begginnerdev 256 Junior Poster

What database type are you using: Access, SQL Server, Oracle, or something else?

Begginnerdev 256 Junior Poster

The Import / Export utility offers Access to SQL Server.

Here is a link for you to look at.

Begginnerdev 256 Junior Poster

Just a curiosity. Is the Microsoft folder an admin only folder,and you happen to be a restricted user?

Begginnerdev 256 Junior Poster

Are you going from SQL Server to SQL Server?

If so, you can use the MS Import/Export wizard to migrate data.

If not, what are you migrating to?

Begginnerdev 256 Junior Poster

Have you tried cycling through the code in debug to see what the log names are?

Just place a break point before the loop, step into the loop (F11) then hover over the entry variable.

(You should change it to For Each e As Entry in objLog)