How To select Particular Cell Value in Grid View
I want to select Particular Cell value and will use to Bind Controls But i am Not able to select Cell Value
Its not retrieving data
I want to select Particular Cell value and will use to Bind Controls But i am Not able to select Cell Value
Its not retrieving data
I have a grid view and need to bind IsActive field.But from the database it comes as 1 or 0.
Error shows System.InvalidCastException: 'Specified cast is not valid.'
protected void Upload(object sender, EventArgs e) { //Extract Image File Name. string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName); //Set the Image File Path. string filePath = "~/Uploads/" + fileName; //Save the Image File in Folder. FileUpload1.PostedFile.SaveAs(Server.MapPath(filePath)); string mycon = "server =localhost; Uid=root; password = ; persistsecurityinfo = True; database =ovs; SslMode = none"; MySqlConnection con1 = new MySqlConnection(mycon); … Read more
I have a simple gridview with button for each row, and I want to pass or display the value of user_full_name_ar in a label, I tried doing this using javascript function as shown below but it doesn’t show the data it shows null,
<ItemTemplate> <asp:Label ID="lbldescription" runat="server" width="175px" Text='<%#Eval("description") %>'/> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtdescription" runat="server"></asp:TextBox> </EditItemTemplate> protected void gvManage_RowUpdating(object sender, GridViewUpdateEventArgs e) { string topicID = gvtopic.DataKeys[e.RowIndex].Values["topicID"].ToString(); TextBox description = (TextBox)gvtopic.Rows[e.RowIndex].FindControl("txtdescription"); string sql = "Update topic SET <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f692938595849f86829f9998cbb692938595849f86829f9998">[email protected]</a> WHERE topicID= @topicID"; var cmd = new MySqlCommand(sql, con); con.Open(); cmd.Parameters.AddWithValue("@topicID",topicID); cmd.Parameters.AddWithValue("@description", description); cmd.ExecuteNonQuery(); con.Close(); gvtopic.EditIndex = … Read more
I am using a GridView which could potentially display half a million records (depending on the options the user selects in filtering the data).
I have a gridview looks like below.
I have created multiple linkbutton on same cell of gridview row. But it’s click event is not firing. On click event, I have to get StudentID defined in RowDataBound of Gridview.
protected void LinkButton_Click(Object sender, EventArgs e) { String MyConnection2 = "Server=localhost;database=ovs;Uid=root;password=; Convert Zero Datetime=True"; DateTime time = DateTime.Now; // Use current time string format = "yyyy-MM-dd HH:mm:ss"; string UserName4 = HttpContext.Current.User.Identity.Name; GridViewRow grdrow = (GridViewRow)((LinkButton)sender).NamingContainer; Label lblStudentId = (Label)grdrow.Cells[0].FindControl("lblID"); string studentId = lblStudentId.Text; String query = "insert into voting (CandidateStudentID,voterStudentID,DateTime)values ('" + lblStudentId.Text + "','" … Read more
I have a GridView combine with data from SQL Server.