Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Gridview With Textbox

Gridview With Textbox

Scheduled Pinned Locked Moved ASP.NET
databasehelp
22 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ _AK_

    So where is the problem?

    Apurva Kaushal

    Y Offline
    Y Offline
    yardly
    wrote on last edited by
    #6

    i am using empty gridrow in my webpage

    _ 1 Reply Last reply
    0
    • Y yardly

      i am using empty gridrow in my webpage

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #7

      How exactly are you trying to insert the value in your database? Are you getting any problem in accessing the value of the textbox or getting the problem in inserting the data into the database?

      Apurva Kaushal

      Y 1 Reply Last reply
      0
      • Y yardly

        totally i am having 7 txtbox . but i cant insert it into my table

        I Offline
        I Offline
        Imran Khan Pathan
        wrote on last edited by
        #8

        have you bound the gridview with some datasource?

        please don't forget to vote on the post that helped you.

        Y 1 Reply Last reply
        0
        • _ _AK_

          How exactly are you trying to insert the value in your database? Are you getting any problem in accessing the value of the textbox or getting the problem in inserting the data into the database?

          Apurva Kaushal

          Y Offline
          Y Offline
          yardly
          wrote on last edited by
          #9

          i am getting error while inserting into the database.. shall i send my coding to u

          _ 1 Reply Last reply
          0
          • I Imran Khan Pathan

            have you bound the gridview with some datasource?

            please don't forget to vote on the post that helped you.

            Y Offline
            Y Offline
            yardly
            wrote on last edited by
            #10

            no i didnt bound with datasource

            I 1 Reply Last reply
            0
            • Y yardly

              i am getting error while inserting into the database.. shall i send my coding to u

              _ Offline
              _ Offline
              _AK_
              wrote on last edited by
              #11

              What is that error?

              Apurva Kaushal

              Y 1 Reply Last reply
              0
              • Y yardly

                no i didnt bound with datasource

                I Offline
                I Offline
                Imran Khan Pathan
                wrote on last edited by
                #12

                So you have to bind it first. Can you tell me what exactly you want

                please don't forget to vote on the post that helped you.

                Y 1 Reply Last reply
                0
                • _ _AK_

                  What is that error?

                  Apurva Kaushal

                  Y Offline
                  Y Offline
                  yardly
                  wrote on last edited by
                  #13

                  i am getting this error: procedure r function not specified for @part_Number..

                  _ 1 Reply Last reply
                  0
                  • I Imran Khan Pathan

                    So you have to bind it first. Can you tell me what exactly you want

                    please don't forget to vote on the post that helped you.

                    Y Offline
                    Y Offline
                    yardly
                    wrote on last edited by
                    #14

                    i have binded gridview like this

                    Y 1 Reply Last reply
                    0
                    • Y yardly

                      i am getting this error: procedure r function not specified for @part_Number..

                      _ Offline
                      _ Offline
                      _AK_
                      wrote on last edited by
                      #15

                      Are you attaching the parameter correctly to the command object?

                      Apurva Kaushal

                      Y 1 Reply Last reply
                      0
                      • Y yardly

                        i have binded gridview like this

                        Y Offline
                        Y Offline
                        yardly
                        wrote on last edited by
                        #16
                        Y 1 Reply Last reply
                        0
                        • _ _AK_

                          Are you attaching the parameter correctly to the command object?

                          Apurva Kaushal

                          Y Offline
                          Y Offline
                          yardly
                          wrote on last edited by
                          #17

                          this s my gridview desingn:

                          _ 1 Reply Last reply
                          0
                          • Y yardly
                            Y Offline
                            Y Offline
                            yardly
                            wrote on last edited by
                            #18

                            did u recevied my coding

                            I 1 Reply Last reply
                            0
                            • Y yardly

                              this s my gridview desingn:

                              _ Offline
                              _ Offline
                              _AK_
                              wrote on last edited by
                              #19

                              Put you code in code tag. Then it will be visible properly.

                              Apurva Kaushal

                              Y 1 Reply Last reply
                              0
                              • Y yardly

                                did u recevied my coding

                                I Offline
                                I Offline
                                Imran Khan Pathan
                                wrote on last edited by
                                #20

                                check "Ignore HTML tags in this message (good for code snippets)" check box and then post your code

                                please don't forget to vote on the post that helped you.

                                Y 1 Reply Last reply
                                0
                                • I Imran Khan Pathan

                                  check "Ignore HTML tags in this message (good for code snippets)" check box and then post your code

                                  please don't forget to vote on the post that helped you.

                                  Y Offline
                                  Y Offline
                                  yardly
                                  wrote on last edited by
                                  #21

                                  hi good morning.. private void BindGrid() { List items = new List(); for (int i = 0; i < 50; i++) { ItemEntry c = new ItemEntry(); items.Add(c); } grdPurEntry.DataSource = items; grdPurEntry.DataBind(); } public void PON_selectedIndexChanged(object src, EventArgs e) { string strPONumber; strPONumber = ddlpurchaseOrdernumber.SelectedItem.Text.ToString(); //BindData(); SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionstring"].ToString()); SqlCommand cmd = new SqlCommand("select MachineName from tbl_PurchaseOrderMaster where Pur_Order_No='" + strPONumber + "'", con); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); // ddlpurchaseOredernumber.Items.Clear(); while (dr.Read()) { txtMachineName.Text = dr["MachineName"].ToString(); //txtInvoiceNum.Text = dr["Invoice_No"].ToString(); } con.Close(); // Load Grid //string strPONumber; //strPONumber = ddlpurchaseOrdernumber.SelectedItem.Text.ToString(); string strPartNumber = ""; string strPartDescription = ""; string strOrderedQuantity = ""; //SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString()); SqlDataAdapter ad = new SqlDataAdapter("SELECT Part_Number,Part_Description,Ordered_Quantity FROM tbl_PurchaseOrderDetails where Pur_Order_No ='" + strPONumber + "'", con);// where MachineName='" + txtMachineName.Text + "'", con); DataSet ds = new DataSet(); ad.Fill(ds, "PurOrderNum"); DataTable dt = ds.Tables[0]; foreach (DataRow dr1 in dt.Rows) { strPartNumber = dr1["Part_Number"].ToString(); strPartDescription = dr1["Part_Description"].ToString(); strOrderedQuantity = dr1["Ordered_Quantity"].ToString(); } //string strPONumber; //strPONumber = ddlpurchaseOrdernumber.SelectedItem.Text.ToString(); foreach (GridViewRow row in grdPurEntry.Rows) { if (row.RowType == DataControlRowType.DataRow) { if (String.IsNullOrEmpty(((TextBox)row.FindControl("txtPartNumber")).Text)) { ((TextBox)row.FindCont

                                  1 Reply Last reply
                                  0
                                  • _ _AK_

                                    Put you code in code tag. Then it will be visible properly.

                                    Apurva Kaushal

                                    Y Offline
                                    Y Offline
                                    yardly
                                    wrote on last edited by
                                    #22

                                    hi good morning.. private void BindGrid() { List items = new List(); for (int i = 0; i < 50; i++) { ItemEntry c = new ItemEntry(); items.Add(c); } grdPurEntry.DataSource = items; grdPurEntry.DataBind(); } public void PON_selectedIndexChanged(object src, EventArgs e) { string strPONumber; strPONumber = ddlpurchaseOrdernumber.SelectedItem.Text.ToString(); //BindData(); SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionstring"].ToString()); SqlCommand cmd = new SqlCommand("select MachineName from tbl_PurchaseOrderMaster where Pur_Order_No='" + strPONumber + "'", con); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); // ddlpurchaseOredernumber.Items.Clear(); while (dr.Read()) { txtMachineName.Text = dr["MachineName"].ToString(); //txtInvoiceNum.Text = dr["Invoice_No"].ToString(); } con.Close(); // Load Grid //string strPONumber; //strPONumber = ddlpurchaseOrdernumber.SelectedItem.Text.ToString(); string strPartNumber = ""; string strPartDescription = ""; string strOrderedQuantity = ""; //SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString()); SqlDataAdapter ad = new SqlDataAdapter("SELECT Part_Number,Part_Description,Ordered_Quantity FROM tbl_PurchaseOrderDetails where Pur_Order_No ='" + strPONumber + "'", con);// where MachineName='" + txtMachineName.Text + "'", con); DataSet ds = new DataSet(); ad.Fill(ds, "PurOrderNum"); DataTable dt = ds.Tables[0]; foreach (DataRow dr1 in dt.Rows) { strPartNumber = dr1["Part_Number"].ToString(); strPartDescription = dr1["Part_Description"].ToString(); strOrderedQuantity = dr1["Ordered_Quantity"].ToString(); } //string strPONumber; //strPONumber = ddlpurchaseOrdernumber.SelectedItem.Text.ToString(); foreach (GridViewRow row in grdPurEntry.Rows) { if (row.RowType == DataControlRowType.DataRow) { if (String.IsNullOrEmpty(((TextBox)row.FindControl("txtPartNumber")).Text)) { ((TextBox)row.FindCont

                                    1 Reply Last reply
                                    0
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • World
                                    • Users
                                    • Groups