第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何:將結(jié)果添加到與登錄相同的數(shù)據(jù)庫

如何:將結(jié)果添加到與登錄相同的數(shù)據(jù)庫

C#
翻翻過去那場雪 2022-11-21 21:28:45
我的應(yīng)用程序顯示了一家餐廳的菜單,在使用數(shù)據(jù)庫中的電子郵件和密碼登錄后,客戶端會(huì)引導(dǎo)您使用一臺(tái)計(jì)算機(jī),該計(jì)算機(jī)會(huì)在特定日期后計(jì)算卡路里。我希望能夠?qū)⒔Y(jié)果放在同一個(gè)數(shù)據(jù)庫和客戶端用作圖像的相同數(shù)據(jù)中。這是我參加比賽的申請private void button1_Click(object sender, EventArgs e){    ani = Convert.ToInt32(textBox1.Text);    cm = Convert.ToInt32(textBox2.Text);    kg = Convert.ToInt32(textBox3.Text);    s = ani + cm + kg;    if (s < 250) label_mesaj.Text = "1800";    else if (s >= 250 && s <= 275) label_mesaj.Text = "2200";    else label_mesaj.Text = "2500";}private void button2_Click(object sender, EventArgs e){    SqlConnection con = new SqlConnection(constr);    con.Open();    SqlCommand cmd = new SqlCommand("insert into Clienti(parola,nume,prenume,adresa,email)values('" + textBox4.Text + "','" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox6.Text + "')", con);    SqlDataAdapter da = new SqlDataAdapter(cmd);    DataSet ds = new DataSet();    da.Fill(ds);}這是在注冊后向我的數(shù)據(jù)庫添加新客戶的代碼,所以我不知道如何記住“id_clienti”我希望“l(fā)abel_mesaj”在使用相同數(shù)據(jù)登錄后顯示在數(shù)據(jù)庫中的“kcal_zilnice”上。
查看完整描述

1 回答

?
jeck貓

TA貢獻(xiàn)1909條經(jīng)驗(yàn) 獲得超7個(gè)贊

這就是我設(shè)法解決問題的方法我記得電子郵件的登錄部分


private void button1_Click(object sender, EventArgs e)

    {

        SqlConnection con = new SqlConnection(constr);

        SqlDataAdapter da = new SqlDataAdapter("Select count(*) from Clienti where email='" + textBox1.Text + "' and Parola='" + textBox2.Text + "'", con);

        DataTable dt = new DataTable();

        da.Fill(dt);

        if (dt.Rows[0][0].ToString() == "1")

        {

            client.email = textBox1.Text;

            this.Hide();

            Form4 ssss = new Form4();

            ssss.Show();

        }

        else MessageBox.Show("verifica datele");

    }

在下一個(gè)表格中


private void button1_Click(object sender, EventArgs e)

    {

        SqlConnection con = new SqlConnection(constr);

        SqlDataAdapter da = new SqlDataAdapter();

        con.Open();if (s < 250)  label_mesaj.Text = "1800";

        da.UpdateCommand = new SqlCommand("Update Clienti set kcal_zilnice= '" + label_mesaj.Text + "' where email= '" + Form3.client.email.ToString() + "'", con);

        da.UpdateCommand.ExecuteNonQuery();

        da.UpdateCommand.Dispose();

        con.Close();

    }


查看完整回答
反對 回復(fù) 2022-11-21
  • 1 回答
  • 0 關(guān)注
  • 101 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)