Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Help sa C#

Status
Not open for further replies.

imba23

Professional
Advanced Member
Messages
165
Reaction score
0
Points
26
Hello po mga master

patulong lang po sa c#, gumagawa po kasi ako ng Offline Otanong lang po kung possible or kung pwede po ba mag save ng values/data mismo sa datagridview from listbox (listtbox to datagridview kumbaga) additional: ang flow po nung system ko is kapag nacheck ko na po yung radiobutton at textbox ma-aadd po yung name at yung cost/price dun sa listbox

eto po yung code ko:

Code:
private void button3_Click(object sender, EventArgs e)
        {
            Data.con.Open();



            string SaveStr = "Insert into tblOrder (CustomerID, CustomerName, CustomerAdd, Date, Orders, TotalPrice) Values (@CustomerID, @CustomerName, @CustomerAdd, @Date, @Orders, @TotalPrice)";
            SqlCommand SaveCmd = new SqlCommand(SaveStr, Data.con);

            SaveCmd.Parameters.AddWithValue("@CustomerID", textBox4.Text);
            SaveCmd.Parameters.AddWithValue("@CustomerName", textBox5.Text);
            SaveCmd.Parameters.AddWithValue("@CustomerAdd", textBox6.Text);
            SaveCmd.Parameters.AddWithValue("@Date", dateTimePicker1.Value);
            SaveCmd.Parameters.AddWithValue("@Orders", listBox1.Items.ToString());
            SaveCmd.Parameters.AddWithValue("TotalPrice", textBox3.Text);

            SaveCmd.ExecuteNonQuery();
            Data.con.Close();
            LoadData();


            Data.con.Open();
            string countstr = "Select count (*) from tblOrder";
            SqlCommand countcmd = new SqlCommand(countstr, Data.con);
            int ctr = Convert.ToInt32(countcmd.ExecuteScalar().ToString());

            ctr = ctr + 1;
            Data.con.Close();

ganto po yung output sa listbbox kappag nagadd ako using checkbox at radiobutton

View attachment 299490

tapos ganto po yung output sa datagridview :lol:
View attachment 299488

alam ko po medyo kangkong yung code ko eto na lang talaga yung kailangan ko pong solusyonan eh haha :lol:
Project nga po pala namin to :D

Thank you po in advance!

- - - Updated - - -

uuppp pa help lang po

- - - Updated - - -

Upp :weep:
 

Attachments

  • shit.PNG
    shit.PNG
    11.5 KB · Views: 6
  • shit11.PNG
    shit11.PNG
    20.7 KB · Views: 9
Last edited:
Status
Not open for further replies.
Back
Top Bottom