Hello I am new in asp.net. I have database which contains 2 table 1. Userdetails, 2.personal records. I had already done the user data entry page and personal records form seperatly.
But now i want to enter any new record i want to enter the whole user details and the following the records. My requirement is the user want to
1. search by userid ie123445P
2. get data in gridview
3. make select option and it redirect to another page (because the record filled had 17 textbox)
4. create add button in another page following by user details (readonly)
5. The new record to be insert and save in respective userid DB
6. view the all details record in girdview
Thats it.
Need help for newbe
S BalajiPosted Apr 6, 2018, 8:27 AM
Line 24:
Line 25:
Line 26: ForeColor="#333333" GridLines="None" CssClass="style3"
Line 27: onselectedindexchanged="GridView1_SelectedIndexChanged">
shafeek ckPosted Apr 6, 2018, 5:52 AM
S BalajiPosted Apr 6, 2018, 2:59 AM
Manav PandyaPosted Apr 5, 2018, 3:24 AM
S BalajiPosted Apr 5, 2018, 3:14 AM
shafeek ckPosted Apr 5, 2018, 2:55 AM
S BalajiPosted Apr 5, 2018, 2:42 AM
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class SearchPanel : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string find = "select * from UserDetails where (userid like '%' + @userid + '%')";
SqlCommand comm = new SqlCommand(find, con);
comm.Parameters.Add("@userid", SqlDbType.NVarChar).Value = TextBox1.Text;
con.Open();
comm.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = comm;
DataSet ds = new DataSet();
da.Fill(ds,"userid");
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
}
}
S BalajiPosted Apr 4, 2018, 10:26 PM
Manav PandyaPosted Apr 4, 2018, 12:38 PM