Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::GeorgeS's Tools

Development::GeorgeS's Tools A forum just for GeorgeS's tools

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2008, 09:41 PM
GeorgeS
Forum Guide
 
Join Date: Sep 2003
Location: California
Posts: 1,474
Default

Just tried the 08 version and the syntax to write and read text files is entirely different, and very hard. Is this something that's different in 08 over the 05 version? Can't believe it's that different. Might as well start learning VC++

GeorgeS
__________________
Your source for EQ database tools
Toolshop is open for business


http://www.georgestools.chrsschb.com//
Reply With Quote
  #2  
Old 06-16-2008, 03:39 PM
EvoZak
Sarnak
 
Join Date: May 2008
Location: Midwest
Posts: 72
Default

Quote:
Originally Posted by GeorgeS View Post
Just tried the 08 version and the syntax to write and read text files is entirely different, and very hard. Is this something that's different in 08 over the 05 version? Can't believe it's that different. Might as well start learning VC++

GeorgeS
George, congratulations on picking up .Net!

Coming from VB you'll have a bit of a learning curve, but once you're past that you'll be good. MSFT has plenty of stuff out there to get you up to speed coming from VB.

As a side note, if you really don't want to leave VB6, isn't MSFT continuing support for the foreseeable future?

Good luck either way!
Reply With Quote
  #3  
Old 06-16-2008, 08:00 PM
sesmar
I built it I will Support it!
 
Join Date: Jun 2005
Location: Michigan
Posts: 214
Default

Quote:
Originally Posted by GeorgeS View Post
Just tried the 08 version and the syntax to write and read text files is entirely different, and very hard. Is this something that's different in 08 over the 05 version? Can't believe it's that different. Might as well start learning VC++

GeorgeS
Reading and writing files is not that hard and is done the same way in 08 as 05.

Writing to a simple text file is as easy as:

Code:
Dim oWriter As StreamWriter 

oWriter = File.AppendText(Filename)
oWriter.WriteLine(Message)

oWriter.Close()
You will need to add:
Code:
Imports System.IO
to you the top of your file if it is not already there as well.

As for accessing MySql you will need to download the MySql.Net connector from http://www.mysql.com

This connector functions exactly like any ADO.Net connector so any tutorial on ADO.Net will give you how it works, you just need to change the varaible types to the appropriate MySql connector types such as:

MySqlDataReader
MySqlDataAdapter

as opposed to:

SqlDataReader
SqlDataAdapter

DataTables and DataSets are all the same whether you use MySql or any other DB.
__________________
Reply With Quote
  #4  
Old 06-19-2008, 10:26 PM
GeorgeS
Forum Guide
 
Join Date: Sep 2003
Location: California
Posts: 1,474
Default

I am using the 05 version since there are still non-depreciated commands. Over the next few weeks I'll dip deeper in the syntax, although in all honesty, I'm leaning towards C++

Does anyone have the mysql connection syntax (i.e an example)?


GeorgeS
__________________
Your source for EQ database tools
Toolshop is open for business


http://www.georgestools.chrsschb.com//
Reply With Quote
  #5  
Old 06-19-2008, 11:15 PM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

Quote:
Originally Posted by GeorgeS View Post
I am using the 05 version since there are still non-depreciated commands. Over the next few weeks I'll dip deeper in the syntax, although in all honesty, I'm leaning towards C++

Does anyone have the mysql connection syntax (i.e an example)?


GeorgeS
Try here, George.

http://tangentsoft.net/mysql++/doc/html/refman
and
http://tangentsoft.net/mysql++/doc/h...man/index.html

might at least get you started...
Reply With Quote
  #6  
Old 06-20-2008, 06:20 AM
LordRathgil
Banned
 
Join Date: Jun 2008
Location: planet earth
Posts: 137
Default

Actually, I think c#.net would be a better choice for database apps, I have had great success with it in the past and it is far far easier to work with as well.
Reply With Quote
  #7  
Old 06-20-2008, 07:26 AM
sesmar
I built it I will Support it!
 
Join Date: Jun 2005
Location: Michigan
Posts: 214
Default

I would recommend C# as well.

As for an example of how to use the MySql.Net Connector:

I have one posted here using C#, if you would like something in VB.net I can convert it over; however, since they are both .Net the object structure and design is all the same only the syntax changes.
__________________
Reply With Quote
  #8  
Old 06-20-2008, 09:13 AM
nosfentora
Discordant
 
Join Date: Oct 2004
Location: In a house
Posts: 387
Default

Hey GeorgeS,

Once you have MySQL Connector.Net 5.1.6 installed,
add a reference to it (MySQL.Data)


Code:
Imports MySql.Data.MySqlClient
Public Class MyClass

    Private mydb As New MySqlConnection()
    Private con_str As String = ""
    Private reader As MySqlDataReader

    Public Sub New()
        con_str = "server=SERVER_IP;Port=3306;user id=root;password=PASSWORD_HERE;database=DATABASE_NAME;persist security info=True"
        mydb.ConnectionString = con_str

        mydb.Open()

        Dim sql_cmd as String = "SELECT * FROM variables"
        Dim cmd As New MySqlCommand(sql_cmd, mydb)

        reader = cmd.ExecuteReader
        While reader.Read
            For i As Integer = 0 To reader.FieldCount - 1
                debug.WriteLine(reader.Item(i).ToString)
            Next
        End While
        reader.Close()
        reader = Nothing
        mydb.Close()
        mydb.Dispose()

    End Sub
End Class

Last edited by Kayot; 06-21-2008 at 04:32 AM.. Reason: Always use code brackets, its the polite way to post code XD
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:42 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3