I write a program for connecting to mysql database and read the values
that i want from the database so i wrote my code like this
RegistryKey uo =
Registry.LocalM achine.OpenSubK ey("SOFTWARE\\O rigin Worlds
Online\\Ultima Online\\1.0");
String folder =
uo.GetValue("Ex ePath").ToStrin g();
String uopath = Path.GetDirecto ryName(folder);
StreamWriter writer = new StreamWriter(uo path +
@"\login.cfg ");
try
{
OdbcConnection mysqlcon;
OdbcCommand mysqlcom = new OdbcCommand();
mysqlcon = new OdbcConnection( "DRIVER={My SQL
ODBC 3.51 Driver};" + "SERVER=localho st;" +
"DATABASE=conne ctor;" + "UID=root;" +
"PWD=root;" );
StringBuilder uobuild = new StringBuilder() ;
uobuild.Append( "select ip,port from baglanti
where id=1");
mysqlcom.Comman dText = uobuild.ToStrin g();
OdbcDataReader resultuo =
mysqlcom.Execut eReader(Command Behavior.CloseC onnection);
String ip =
resultuo.GetVal ue(0).ToString( );
writer.WriteLin e("LoginServer= "+ip+",5631 ");
writer.Close();
}
catch
{
this.txt1.Text += "Dosya Bulunamadi";
}
but its not working what is the problem?
Note:My program should take both ip and port part from mysql and write
it to file that i want
Thanks
*---------------------------------*
Posted at: http://www.GroupSrv.com
*---------------------------------*
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com