?
Solved

writing to a database on my website

Posted on 2012-09-13
6
Medium Priority
?
558 Views
Last Modified: 2012-09-18
I am fairly new to using databases.  I currently have a windows form application that has it's own database to save client information.  The database is stored locally on the user's computer, and I can easily access it to pull records and update client information.

When an error occurs in the software it sends out an email to me with the error code and the line number so that I can correct it.  Also, when the user registers the software, I am sent another email with the registration code and expiration date for the software.

What I would like to do is have a database that is stored on my website so that if an error occurs, the program will attempt to write the error message to my online database, then if it fails, proceed with sending the email so that I can still receive the error code.  I would like the same idea for the registration and expiration date to be stored on a website database instead of emailing to me.

I don't have any work to show, because I am completely stumped at line 1.  Can someone send me in the right direction to accomplish this?  Essentially, each user should have their own local database, but all users' programs can write to a single error and registration database on my website.

I am using vb.net, visual studio 2010, and I have a godaddy website.
0
Comment
Question by:lostinthegame
  • 3
  • 2
6 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 38396601
Do you have a database already? If not, I suggest you use MySQL. it is open source and is supported by godaddy
0
 

Author Comment

by:lostinthegame
ID: 38396612
I built a quick on using godaddy's website.  I was actually tooling around with it when you posted.  I may be getting somewhere because it gave me a php connection string.  I guess I just need to figure out how to connect using vb.net.
0
 
LVL 12

Expert Comment

by:Jared_S
ID: 38396643
I have very limited experience with this, but you should look into sending SOAP messages from the client and  consuming them with a web service.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 35

Accepted Solution

by:
YZlat earned 2000 total points
ID: 38396731
MySqlConnection conn = New MySqlConnection()
conn.ConnectionString = “server=” & server & “;” _
& “user id=” & Username & “;” _
& “password=” & Password & “;” _
& “database=dbname”

Try
conn.Open()
MessageBox.Show(“Connection Opened Successfully”)
conn.Close()
Catch myerror As MySqlException
MessageBox.Show(“Error Connecting to Database: ” & myerror.Message)
Finally
conn.Dispose()

End Try

Open in new window

0
 

Assisted Solution

by:lostinthegame
lostinthegame earned 0 total points
ID: 38396996
I tried that.  First I had to download and install MySQL Connector Net 6.5.4 and add the reference to my project.

I get the error: Unable to connect to any of the specified MySQL hosts.

here is what i'm using:

        'Connect To Database
        Dim MysqlConn As MySqlConnection
        MysqlConn = New MySqlConnection()

        Try

            MysqlConn.ConnectionString = "server="server given to me on godaddy's site"; user id="mylogin"; password="mypassword"; database=lostinthegame"

            MysqlConn.Open()

            MsgBox("Connection to Database has been opened.")

        Catch ex As Exception
            MysqlConn.Close()
            MsgBox(ex.Message)
        End Try

Open in new window

0
 

Author Closing Comment

by:lostinthegame
ID: 38408817
Got it working between both installing Mysql connector and writing the connection string as listed.  The issue was that the godaddy database was restricted from direct access.  Made a new database, and now I'm good to go.

Thanks
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Progress

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question