Thanks for the suggestion Oxiegen, I have added "port=3306" to the connection string, but no difference.

I have already added a user from the 'server administration' panel on the workbench, and have ticked the same boxes as when it was originally on the XP machine. I already had mysql installed on my dev laptop for testing, so I changed my connection string back to use the "127.0.0.1" IP address and this connects fine. I think that this proves that my VB Net coding is correct, and that my connection string is correct. It therefore points to the Ubuntu server as being the problem, so I did a bit more testing: if I remove the user from the Ubuntu server, (workbench, server administration, security, users and privileges - remove) and try to connect I still get the same message (i.e. Unable to connect to any of the specified MySQL hosts.) I don't get any username / password errors. Does this have any relevance?

Have installed fresh connector on the client (6.4.4 to 6.5.4), but no difference.
The username I have specified on the server has 'limit connectivity to hosts matching' set to % as I understood this means 'remote' - is this correct?

Do you mean I should install the adapter/connector on the client, or on the server?

toomutch 8 Newbie Poster

Hi All,
Don't know if this is the right forum for this query, but couldn't find anything more suitable.
I have written a new app in VB.net as a front end to a mySQL database held on a PC on the LAN running Windows XP. This worked fine for a while. The PC running the mySQL server started locking up (XP errors, not mySQL errors according to the event logs), so I decided to have a go installing Ubuntu to run the mySQL server to see if that was more stable.
Ubuntu 11.10 is now installed, and mysql server is also running. I have imported the old sql database files and the mySQL workbench shows all tables are imported successfully.

HOWEVER, I cannot get my VB application to connect to the database now it resides on Ubuntu - just returns "Unable to connect to any of the specified MySQL hosts" when i try to open a connection. I am fairly new to Ubuntu and MySQL, and don't know if the fault lies with the O/S (a firewall config problem perhaps?) or if I need to do something different with mySQL.
I can ping the Ubuntu pc from the client pc and vice versa.
I have used ufw to open port 3306 on the server
The ufw logs do not show any errors when I try to connect from the client pc, so I don't think it's a firewall problem (but could be wrong).
I thought it may be something to ...

Thanks for the link. After a bit of playing, I got it to work, but it's not really what I'm after. I got MapPoint to work a few years ago with VB6, so I'll keep playing and see if I can get it going with VB.NET.

Thanks anyway
toomutch

Thanks for the advice. Found the geocode extension, clicked download and it just takes me to a website. I found the zip file to download, but how do I add this to my project (sorry - haven't used extensions before)
toomutch

your question is a bit vague, but from what I understand, I would have two tables - one for order numbers, order date, name of person ordering etc, and a second table recording the items ordered. Use the order number as a foreign key in the second table.

Toomutch

toomutch 8 Newbie Poster

Hi All,
I need to show a map, plotting addresses that are held on a sql database. Has any one come across any software suitable for this task (i.e. can be built into vb.net). I have tried using MS MapPoint, which according to the write up says it will do the job, but I cannot get it to work (posting on here didn't get any response) so I wondered if there was a more popular mapping utlity out there?

Many thanks,
Toomutch

toomutch 8 Newbie Poster

Hi all,
What seems like a fairly straightforward process has got me stumped! How do I show a MapPoint map on a VB Net form?

I have MapPoint 2011 (Europe) installed on my dev pc, and have added the references "Microsoft MapPoint 18.0 Object Library (Europe)" and "Microsoft MapPoint Utilities 1.0 Type Library" to my project, but there is no new 'tool' in the toolbox to allow me to add a map object to the VB.NET form.

I am completely self-taught with VB.NET (Visual Studio 2010 Pro), so guess I must have missed something obvious.

Any pointers greatly appreciated.

Toomutch

Hadn't thought of the SQL injection loophole. Thanks for the info - guess I'll have to go and rewrite LOADS of code!

That got it! thanks for the prompt reply

just doing something similar myself, and have thought of something else that may help in the long run. I don't know if you've stripped down your code to make it simpler for this forum, but as it stands you may have a problem. My suggestion above will fail if the user enters text with an apostrophe in it! (e.g. if the user enters a last name of "O'Shea" for example). The sql command uses apostrophes to separate input items so falls over if it finds an extra one.
Before you issue the 'insert' sql command you will need to remove unwanted characters from each string. Suggest you have a look at "Regular Expressions".
toomutch

I would use a different sql command:
[CODE]
cmd.commandtext = "insert into staff (firstname, lastname, address) values ('" _
& firstname &"', '" & lastname & "', '" & address & "')"
[/CODE]
you can then remove the 'cmd.parameters...' commands

Toomutch

toomutch 8 Newbie Poster

Hi all,
my current project shows a single page tabcontrol with a datagridview. I read names from a mysql table, and create an additional tab page for each person (there's only ever going to be half a dozen or so, so it should be manageable).
I want to duplicate the controls on the first page onto each additional page as I add it. I have tried a couple of example I found on the net, but can't get them to work.
[CODE]
'Load Engineer Names, and create one tab for each engineer
Dim myEngineerCounter As Integer = 0
Dim myEngineerName(20) As String
Dim myEngineerID(20) As Integer
Dim myEngineerActive(20) As Boolean
Dim dgvMonday As New DataGridView
mySQLstring = "select idEngineers, EngineerName from engineers where engineeractive = 'y'"
mySQLcmd.CommandText = mySQLstring
mySQLdr = mySQLcmd.ExecuteReader

        Do While mySQLdr.Read()
            myEngineerCounter = myEngineerCounter + 1
            myEngineerID(myEngineerCounter) = Convert.ToString(mySQLdr(0))
            myEngineerName(myEngineerCounter) = Convert.ToString(mySQLdr(1))
            tabSchedules.TabPages.Add(myEngineerName(myEngineerCounter))
  '-----Here's where I add the dgv
            tabSchedules.TabPages.Item(myEngineerCounter).Controls.Add(dgvMonday)
        Loop[/CODE]

When I run the program, the tabs are created and named correctly but only the last page has the dgv on it. I guess this is because I can't have multiple controls on the form with the same name ("dgvMonday" in this case) so how do I duplicate the controls onto the new tabpages? I have tried to define dgvMonday as an array, but then get an error because you can't use an array with 'new'.
I have also looked at trying to duplicate the first tabpage, but cannot get that to work either.
The ...

Hi Guys, couldn't get the dgv to display what I wanted (I either wanted a date, or blank but couldn't get the blank to come out properly). I ended up changing the date column to an integer column and storing the date as an integer with zero for blank, and adding a new column to my table called "DisplayedDate" defined as varchar(10). I then show the DisplayedDate in the dgv, but can still do the calculations on my integer column. Thanks for the input.
Toomutch

toomutch 8 Newbie Poster

Hi all,
Having problems with null dates in a mysql table. Have eventually found out that I can store a 'null' date in mysql as "0000-00-00" and I can run the 'insert' command to add a record to the mysql table. When I check on mysql workbench I can see the row has been inserted correctly and the date shows as "0000-00-00".

However...
When I try to load the table into a datagridview, I get an error = mysql Conversion Exception was unhandled = "Unable to convert MySQL date/time value to System.DateTime".

how do I get the datagridview (or VB.NET as a whole?) to handle zero dates. Alternatively is there a different method of storing a null date, rather than zero date.

Many Thanks, Toomutch

finally got it sorted. I was showing data in a datagridview, and when the user clicked a row, text was sent to a textbox. However, once a row had been selected it was possible for the user to change the row by using the up and down cursor keys. This wasn't picked up by the 'cellclick' event.

I moved all of the code from within the cellclick event into a new sub "updateTextBox" and called this sub from the cellclick event. I then added new events "keyup" and "keydown" and called the "updateTextBox" sub from each.

Thanks for all the input folks.

Toomutch

[QUOTE=ChrisPadgham;1748678]you could try the cursorChanged event[/QUOTE]

the cursorchanged event does not activate when using either mouse or cursor keys to change the selection in the dgv.

I have tried selectionchanged event, but this crashes on form load (presumably loading the datagrid on formload is classed as a selctionchange and triggers the event too early?)

[QUOTE=codeorder;1748543]I have no idea(s) regarding "network.share", though here is a suggestion.
Have a small sidekick.app installed on each user's p.c., that does the "copy and overwrite the existing application executable in the program files\app directory".

I'm not sure how systems work with network.sharing, though there should be a folder somewhere, where everyone can access it.
If it does, load a simple .txt file in there, saying that there is a new.version and load your updated.exe in there also.

If their app. finds this file, Then to load the little sidekick.app, close it's self, and have the sidekick app do all the leg.work.[/QUOTE]

Agree with codeorder. Get the users to always launch program1. If the shared folder is empty, then program2 is launched, if the folder contains a file, this file overwrites program2, then program2 is launched.
Keep program1 as simple as possible so you don't have to update that as well
toomutch

toomutch 8 Newbie Poster

Hi All,
I have a vb net program that shows a datagridview which pulls data from a mySQL database. When the user clicks on a row (I am checking for a 'cellclick' event), a text box is filled with data from a hidden column in the datagridview. This works fine and runs without error, BUT...
When I use the cursor keys to move the selection up or down, the row highlight changes, but doesn't update the text box. I realise that this is because I am looking for a 'cellclick' event, but I don't know how to look for cursor keys as well.

Please could someone tell me what event I should be looking for to capture input via both mouse click and cursor. I have changed the program so it updates the second dgv on 'selectionchanged' but this crashes at run time with an InvalidCastException.
Alternatively, is it possible to stop the user using the cursor keys?

Many thanks,
Toomutch