Click here to Skip to main content
15,891,529 members
Home / Discussions / C#
   

C#

 
QuestionHow to display the Build number in a text box? (I'm a newbie to C#) Pin
Albert Giraudi20-Dec-08 5:33
Albert Giraudi20-Dec-08 5:33 
AnswerRe: How to display the Build number in a text box? (I'm a newbie to C#) [modified] Pin
Luc Pattyn20-Dec-08 6:30
sitebuilderLuc Pattyn20-Dec-08 6:30 
AnswerRe: How to display the Build number in a text box? (I'm a newbie to C#) Pin
RobScripta20-Dec-08 15:47
professionalRobScripta20-Dec-08 15:47 
Questionc# login help Pin
cobalt-rose20-Dec-08 1:51
cobalt-rose20-Dec-08 1:51 
AnswerRe: c# login help Pin
N a v a n e e t h20-Dec-08 2:17
N a v a n e e t h20-Dec-08 2:17 
GeneralRe: c# login help Pin
cobalt-rose20-Dec-08 2:32
cobalt-rose20-Dec-08 2:32 
AnswerRe: c# login help Pin
Christian Graus20-Dec-08 10:14
protectorChristian Graus20-Dec-08 10:14 
AnswerRe: c# login help Pin
RobScripta20-Dec-08 16:01
professionalRobScripta20-Dec-08 16:01 
I use MySql in combination with C# as well. To answer the question from Cristian why using MySql instead of SQLServer: to get the best of both worlds, and have a rich user interface with a windows forms application, combined with a database that can be reached over the internet.

First of all, use the MySQL .net components provided by MySql, and create a reference to it in your projects. Don't forget the using statement:

using MySql.Data.MySqlClient;

I then use a number of standard functions like:

public static bool RunSQL(string sql, string ConnectString)
{
MySqlConnection ConnMySQL;
MySqlCommand cmdMySql = new MySqlCommand();

ConnMySQL = new MySqlConnection(ConnectString);
cmdMySql.Connection = ConnMySQL;
try
{
ConnMySQL.Open();
//Execute SQL
cmdMySql.CommandText = sql;
cmdMySql.ExecuteNonQuery();
}
catch (Exception e)
{
System.Windows.Forms.Clipboard.SetText(sql);
if (e.Message.ToString().IndexOf("Duplicate entry") < 0)
{
System.Windows.Forms.MessageBox.Show(e.Message);
}
return false;
}
finally
{
ConnMySQL.Close();

}
return true;

}

The connectstring is something like:

public static string ConnectString()
{
string Connectstring = @"server=yourservername;uid=yourusername;pwd=yourpassword;database=yourdatabasename;";

return Connectstring;
}

I hope this will get you on the right track
GeneralRe: c# login help Pin
cobalt-rose21-Dec-08 1:49
cobalt-rose21-Dec-08 1:49 
GeneralRe: c# login help Pin
RobScripta21-Dec-08 20:58
professionalRobScripta21-Dec-08 20:58 
GeneralRe: c# login help Pin
cobalt-rose22-Dec-08 13:19
cobalt-rose22-Dec-08 13:19 
GeneralRe: c# login help Pin
RobScripta22-Dec-08 23:49
professionalRobScripta22-Dec-08 23:49 
GeneralRe: c# login help Pin
cobalt-rose23-Dec-08 22:18
cobalt-rose23-Dec-08 22:18 
GeneralRe: c# login help Pin
RobScripta23-Dec-08 22:58
professionalRobScripta23-Dec-08 22:58 
GeneralRe: c# login help Pin
cobalt-rose24-Dec-08 1:56
cobalt-rose24-Dec-08 1:56 
GeneralRe: c# login help Pin
RobScripta24-Dec-08 3:45
professionalRobScripta24-Dec-08 3:45 
GeneralRe: c# login help Pin
cobalt-rose24-Dec-08 13:05
cobalt-rose24-Dec-08 13:05 
GeneralRe: c# login help Pin
RobScripta24-Dec-08 20:50
professionalRobScripta24-Dec-08 20:50 
QuestionDowngrading ReaderWriterLockSlim UpgradeableReadLock to simple ReadLock Pin
HosamAly19-Dec-08 23:28
HosamAly19-Dec-08 23:28 
AnswerRe: Downgrading ReaderWriterLockSlim UpgradeableReadLock to simple ReadLock Pin
N a v a n e e t h20-Dec-08 0:57
N a v a n e e t h20-Dec-08 0:57 
GeneralRe: Downgrading ReaderWriterLockSlim UpgradeableReadLock to simple ReadLock Pin
HosamAly20-Dec-08 2:41
HosamAly20-Dec-08 2:41 
GeneralRe: Downgrading ReaderWriterLockSlim UpgradeableReadLock to simple ReadLock Pin
N a v a n e e t h20-Dec-08 7:32
N a v a n e e t h20-Dec-08 7:32 
Questionhow to write the values in textbox to xml format.. Pin
samsonx19-Dec-08 22:26
samsonx19-Dec-08 22:26 
AnswerRe: how to write the values in textbox to xml format.. Pin
Eddy Vluggen19-Dec-08 22:33
professionalEddy Vluggen19-Dec-08 22:33 
GeneralRe: how to write the values in textbox to xml format.. Pin
samsonx19-Dec-08 22:49
samsonx19-Dec-08 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.