Click here to Skip to main content
15,909,498 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Validation of viewstate MAC failed. Pin
Sandeep Mewara24-Sep-12 20:13
mveSandeep Mewara24-Sep-12 20:13 
QuestionVB.NET with MSAccess Pin
Kothai Krishnamoorthy23-Sep-12 19:35
Kothai Krishnamoorthy23-Sep-12 19:35 
AnswerRe: VB.NET with MSAccess Pin
Richard MacCutchan23-Sep-12 21:45
mveRichard MacCutchan23-Sep-12 21:45 
AnswerRe: VB.NET with MSAccess Pin
Mazumder.Soumen25-Sep-12 2:22
Mazumder.Soumen25-Sep-12 2:22 
Questionresizing a form in corner, bottom,right Pin
gopal karmakar21-Sep-12 6:04
gopal karmakar21-Sep-12 6:04 
QuestionRe: resizing a form in corner, bottom,right Pin
Eddy Vluggen21-Sep-12 6:20
professionalEddy Vluggen21-Sep-12 6:20 
QuestionLookup table .NET Component Pin
HentoDeluxe21-Sep-12 5:26
HentoDeluxe21-Sep-12 5:26 
AnswerRe: Lookup table .NET Component Pin
Eddy Vluggen21-Sep-12 6:19
professionalEddy Vluggen21-Sep-12 6:19 
QuestionConverting from base10 to base16 and save it in unsigned char array? Pin
Kiran Satish19-Sep-12 10:06
Kiran Satish19-Sep-12 10:06 
AnswerRe: Converting from base10 to base16 and save it in unsigned char array? Pin
Richard MacCutchan19-Sep-12 11:28
mveRichard MacCutchan19-Sep-12 11:28 
GeneralRe: Converting from base10 to base16 and save it in unsigned char array? Pin
Kiran Satish19-Sep-12 11:36
Kiran Satish19-Sep-12 11:36 
GeneralRe: Converting from base10 to base16 and save it in unsigned char array? Pin
Richard MacCutchan19-Sep-12 11:52
mveRichard MacCutchan19-Sep-12 11:52 
QuestionWhat is Common Type System (CTS) in .net framework? Pin
hiredotnet16-Sep-12 19:48
hiredotnet16-Sep-12 19:48 
AnswerRe: What is Common Type System (CTS) in .net framework? Pin
Pete O'Hanlon16-Sep-12 19:56
mvePete O'Hanlon16-Sep-12 19:56 
AnswerRe: What is Common Type System (CTS) in .net framework? Pin
Himanshu Yadav20-Sep-12 8:11
Himanshu Yadav20-Sep-12 8:11 
AnswerRe: What is Common Type System (CTS) in .net framework? Pin
Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)22-Sep-12 19:01
protectorTadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)22-Sep-12 19:01 
QuestionMain components of .NET Framework Pin
hiredotnet16-Sep-12 19:45
hiredotnet16-Sep-12 19:45 
RantRe: Main components of .NET Framework Pin
Paul Conrad16-Sep-12 19:48
professionalPaul Conrad16-Sep-12 19:48 
Questioni m new in asp.net. and i want 2 call a gridview by dropdownlist. Pin
Rashid Choudhary13-Sep-12 22:27
Rashid Choudhary13-Sep-12 22:27 
i have a drop down list which have three entry.when i select every entry of dropdownlist then the data show into the gridview...my code behind page is


C#
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Net.Mail;
using System.IO;
using System.ComponentModel;
using System.Drawing;
using System.Web.SessionState;

namespace AccountManagement
{
    public partial class Account : System.Web.UI.Page
    {
        SqlConnection con;
       SqlDataAdapter da;
        SqlDataReader dr;
        //DataSet ds1;
       // String Sql;
        //int Count;
        DataTable dt;
        SqlCommand cmd;
        protected void Page_Load(object sender, EventArgs e)
        {
            string s = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
            con = new SqlConnection(s);
            //if (!IsPostBack)
            //{
            //    bindgrid();
            //    bindlst();
            //}
            con.Open();
        }

        //protected void Button1_Click(object sender, EventArgs e)
        //{
        //    bindgrid();
        //    GridView1.Visible = true;
            
        //}
        public void bindgrid()
        {
            cmd=new SqlCommand ("select distinct Fname,Lname from Client_registration_tbl",con);
            //ds1 = new DataSet();
            con.Open();
            dr = cmd.ExecuteReader();
            //da.Fill(ds1);
            GridView1.DataSource = dr;
            GridView1.DataBind();
            GridView1.Visible = true;
            con.Close();

        }

        public void bindlst()
        {
            da = new SqlDataAdapter("select distinct Fname,Lname from Client_registration_tbl", con);
            dt = new DataTable();
            da.Fill(dt);
            DropDownList1.DataSource = dt;
            DropDownList1.DataBind();
        }
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {

            da = new SqlDataAdapter("select distinct Fname,Lname from Client_registration_tbl" + DropDownList1.SelectedItem.Text + "", con);
            dt = new DataTable();
            da.Fill(dt);
            GridView1.DataSource = dt;
            GridView1.DataBind();
           
            bindgrid();
            bindlst();
            //GridView1.Visible = true;
        }

      


    }
}

thanksss in advance
AnswerRe: i m new in asp.net. and i want 2 call a gridview by dropdownlist. PinPopular
Richard MacCutchan13-Sep-12 23:31
mveRichard MacCutchan13-Sep-12 23:31 
GeneralRe: i m new in asp.net. and i want 2 call a gridview by dropdownlist. Pin
Rashid Choudhary13-Sep-12 23:36
Rashid Choudhary13-Sep-12 23:36 
GeneralRe: i m new in asp.net. and i want 2 call a gridview by dropdownlist. Pin
Pete O'Hanlon13-Sep-12 23:40
mvePete O'Hanlon13-Sep-12 23:40 
GeneralRe: i m new in asp.net. and i want 2 call a gridview by dropdownlist. Pin
Richard MacCutchan14-Sep-12 0:05
mveRichard MacCutchan14-Sep-12 0:05 
GeneralRe: i m new in asp.net. and i want 2 call a gridview by dropdownlist. Pin
Pete O'Hanlon14-Sep-12 0:28
mvePete O'Hanlon14-Sep-12 0:28 
GeneralRe: i m new in asp.net. and i want 2 call a gridview by dropdownlist. Pin
Richard MacCutchan14-Sep-12 0:44
mveRichard MacCutchan14-Sep-12 0:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.