Windows Develop Bookmark and Share   
 index > Windows Forms General > Help me - Value
 

Help me - Value

Hi my friends I'm with a problem. I have 2 radiobutton 1 is female other is man now I have that put the value of 1 and 2 and put in my column only that the variable only put 1.. please see me code...

string sexo = "'" + radioButton1.Text + "'";

string[] texto = new string[2];

texto[0] = radioButton1.Text;

texto[1] = radioButton2.Text;

What I have to do here..?

Thank you!

Leandro Rodrigues  Saturday, August 19, 2006 1:29 AM

is this not the exact same as this:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=648417&SiteID=1

with the solution given?

if not - can you please rephrase the question as it is not exactly clear what you want to achieve

ahmedilyas  Saturday, August 19, 2006 1:34 AM

Okay.. this code is perfect.. But I want to do a code that move a lot my code actual that is:

public static void Insert_SQL(string nick, string email, string nome, string datanasc, string ruaenumero, string bairro, string cidade, string cep, string país, string sexo, string estado, string home_page)

{

string table = "clientes";

MySqlCommand com = new MySqlCommand();

try

{

com.Connection = Conexão_mysql();

StringBuilder query = new StringBuilder();

query.Append("INSERT INTO ");

query.Append(table);

query.Append(" (nick,email,nome,datanasc,ruaenumero,bairro,cidade,cep,país,sexo,feminino,estado,home_page) VALUES (");

query.Append((nick));

query.AppendFormat(", {0}", (email));

query.AppendFormat(", {0}", (nome));

query.AppendFormat(", {0}", (datanasc));

query.AppendFormat(", {0}", (ruaenumero));

query.AppendFormat(", {0}", (bairro));

query.AppendFormat(", {0}", (cidade));

query.AppendFormat(", {0}", (cep));

query.AppendFormat(", {0}", (país));

query.AppendFormat(", {0}", (sexo));

query.AppendFormat(", {0}", (estado));

query.AppendFormat(", {0}", (home_page));

query.Append(")");

com.CommandText = query.ToString();

private void button1_Click(object sender, System.EventArgs e)

{

string nick = "'" + txt_apelido.Text + "'";

string email = "'" + txt_email.Text + "'";

string nome = "'" + txt_nome.Text + "'";

string datanasc = "'" + textBox4.Text + "'";

string ruaenumero = "'" + textBox7.Text + "'";

string bairro = "'" + txt_ruaenumero.Text + "'";

string cidade = "'" + textBox5.Text + "'";

string cep = "'" + textBox8.Text + "'";

string país = "'" + comboBox1.Text + "'";

string sexo = "'" + radioButton1.Text + "'";

string[] texto = new string[2];

texto[0] = radioButton1.Text;

texto[1] = radioButton2.Text;

string estado = "'" + comboBox2.Text + "'";

string home_page = "'" + textBox9.Text + "'";

See my problem actual my friends.. Thank you a lot!!! and that post is a great! Thank you !! again

Leandro Rodrigues  Saturday, August 19, 2006 1:49 AM

You can use google to search for other answers

Custom Search

More Threads

• OwnerDraw, Localisation, ReBar (CoolBar)
• Drag a picturebox/image within a panel
• centering a window
• How do create setup as trial version
• UseEXDialog when using a PrintHookProc
• Launching cmd.exe and executing commands from it in WinForm
• Inadvertant window maximization when clicking on title bar?
• Textbox and time
• Fillpolygon-unknown number of points
• Unwanted Selectindex event fired up!!