Hi,
I am building a new application (Forms) to display GPS information etc on a laptop. I have been able to parse teh NMEA stntances and grab the information I need BUT now I need to download/upload the route information to/from the GPS unit.
I have been unsuccessful so far in finding any code examples etc to help me.
Can anyone steem me to something?
Using VS2008, C#, .NET 3.5, Visio.
Thanks
Phill
Loading
Sam HobbsPosted Jul 23, 2010, 9:08 PM
theLizardPosted Jul 23, 2010, 8:25 PM
private void MDI_Main_Activated_1(object sender, EventArgs e)
{
this.GetMDIVesselNameID();
this.ucVessel1.ChangeVessel = true;
}
public DataTable QueryDataGet(string pSQLText)
{
ErrorLogClass class2;
DataTable table2;
try
{
OleDbDataAdapter adapter = new OleDbDataAdapter(pSQLText, this.CreateConnection());
OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);
DataTable dataTable = new DataTable();
adapter.Fill(dataTable);
class2 = new ErrorLogClass();
class2.LogCode = 0;
class2.LogModule = "Query Data Get";
class2.LogMessage = "Success Records returned. ( " + dataTable.Rows.Count.ToString() + ")";
class2.LogMessageToFile();
table2 = dataTable;
}
catch (OleDbException exception)
{
class2 = new ErrorLogClass();
class2.LogCode = 8;
class2.LogModule = "Query Data Get";
class2.LogMessage = "An error occured. (" + exception + ")";
class2.LogMessageToFile();
table2 = new DataTable();
}
finally
{
this.dbConn.Close();
}
return table2;
}
PS. This is why I mentioned "or will you be wanting to keep your source code safe from reverse engineering"
Also, as a general rule, it is not wise to show error details of the database exception, this gives insight to hackers wanting to penetrate security via vulnerabilities. It is best just to catch an Exception and log where the exception occurred.
Note: I do not expect that database security is an issue here but what I have said above is a general rule of good database design.
Regards.
theLizardPosted Jul 23, 2010, 7:46 PM
I downloaded the beta of YachtMaster from your site and installed it, I have some come constructive criticism, well one actually, if OLEDB is not registered on the computer you get an error which cannot be closed down without using Task Manager, not really good for people who do not know a lot about computers.
I have attached an image of the error.
You should first check that the requirements for the application have been established during the setup process, if something is missing that is needed you should either provide it as an installation option or point to where the required software can be downloaded from.
Can I make a suggestion, since I got this error message because I do not have OLEDB registered would you consider using ODBC instead of OLEDB since ODBC is part of all windows installations..
Regards...
theLizardPosted Jul 23, 2010, 7:09 PM
I am interested in what you are doing, I assume you have found this sentance for what you are after.
Sam HobbsPosted Jul 23, 2010, 3:21 PM
I had no problems find the driver, unless there is a separate driver for use of serial communications over USB for Garmin devices.
I did once find something in the Microsoft site about GPS but I did not understand what it is for or does or whatever. I don't remember where it is.
Phillip SeamanPosted Jul 23, 2010, 1:56 PM
I am using a Garmin for now but I believe that they all use the same NMEA sentance structure to communicate with other instruments. I guess I'll find out as I go along! I would love it to be a standard!
The USB connection is rather trickey as it needs the spacific drivers (32bit or 64bit) which are hard to locate but once installed the usual Serial (Com) port object works fine.
Thanks
SquireDude
Sam HobbsPosted Jul 23, 2010, 11:50 AM
Phillip SeamanPosted Jul 23, 2010, 11:05 AM
Thanks for you insightful response.
As I noted above I am in the process or completing a new Marine product to assist boaters in maintaining a log of there trips.
I am currently testing against a Garmin GPS (several models), using a Serial port cable with adaptor and drivers. I am reading the NMEA (National Marine Electronics Association) standard sentances with no real problem.
I found out late last night that one of the sentances send the Route/Trip information it was very burried so I think I just have to do a bit more reading and then code for the new sentance.
If anyone is interested let me know and I'll put together some sort of post here... For now I have beta versions available for FREE download on the Downloads page of http://www.SeamanMarineSoftware.com
Thanks
SquireDude
Sam HobbsPosted Jul 23, 2010, 1:15 AM