Click here to Skip to main content
15,075,394 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Server Error in '/aspx' Application. Pin
nothingbutcat29-Mar-07 6:50
Membernothingbutcat29-Mar-07 6:50 
QuestionAjax control doesn't work in Firefox and other computers? Pin
Abubakarsb29-Mar-07 4:49
MemberAbubakarsb29-Mar-07 4:49 
QuestionSSL ERROR Pin
lajith29-Mar-07 3:05
Memberlajith29-Mar-07 3:05 
Questionhow to generate reprot using sql server 2000 reporting service Pin
mohd imran abdul aziz29-Mar-07 2:37
Membermohd imran abdul aziz29-Mar-07 2:37 
AnswerRe: how to generate reprot using sql server 2000 reporting service Pin
Not Active29-Mar-07 4:38
mentorNot Active29-Mar-07 4:38 
QuestionDisplay a project member in the listbox Pin
Oga M29-Mar-07 2:04
MemberOga M29-Mar-07 2:04 
AnswerRe: Display a project member in the listbox Pin
Tirthadip29-Mar-07 2:44
MemberTirthadip29-Mar-07 2:44 
AnswerRe: Display a project member in the listbox Pin
Naveed Kamboh29-Mar-07 2:48
MemberNaveed Kamboh29-Mar-07 2:48 
you need to make master + detail
Well your problem needs more explination.

If your data is in a single table then, first you need to bind dropdownlist with the required field you can use
follwoing code or write your on code to fill the drop down list

public void BindDropDownListWithQuery(string sql, DropDownList ddl)
{

try
{


mysqlCommand = new MySqlCommand(sql);
dbConnect();
mysqlCommand.Connection = connection;
mysqlAdapter = new MySqlDataAdapter(mysqlCommand);
dataset = new DataSet();
mysqlAdapter.Fill(dataset, "Table");
ddl.DataSource = dataset.Tables[0];
ddl.DataTextField = dataset.Tables[0].Columns[0].ColumnName.ToString();
ddl.DataValueField = dataset.Tables[0].Columns[1].ColumnName.ToString();
ddl.DataBind();
}
catch (Exception)
{
connection.Close();
connection.Dispose();
}
finally
{
connection.Close();
connection.Dispose();
}
}

then you need to show Details for which you can use data grid
Now its really depend if you are filling datagrid on load event with all records then you need to filter datagrid on the basiss of value selected from dropdownlist
you can do that using this code

if (this.RadioButtonList1.SelectedIndex == 0)
{
this.odsImages.FilterExpression = "fieldname=" + this.DropDownList1.SelectedValue;


}
else if (this.RadioButtonList1.SelectedIndex == 1)
{

this.odsImages.FilterExpression = "field name=" + this.DropDownList1.SelectedValue;
}

if you are not filling datagrid onload event of web form then

you need to fill data grid with select query and you can do this using follwoing code


public void BindDataGrid(string sql, GridView GV)
{

dbConnect();
try
{
mysqlCommand = new MySqlCommand(sql);

mysqlCommand.Connection = connection;
mysqlAdapter = new MySqlDataAdapter(mysqlCommand);
dataset = new DataSet();
mysqlAdapter.Fill(dataset, "Table");
GV.DataSource = dataset;
GV.DataBind();
}
catch (Exception)
{

}
finally
{
connection.Close();
connection.Dispose();
}
}

sql="select * from tbl where fieldname=" + dropdownlist.selectedvalue;



GeneralRe: Display a project member in the listbox Pin
Not Active29-Mar-07 4:13
mentorNot Active29-Mar-07 4:13 
AnswerRe: Display a project member in the listbox Pin
postmaster@programmingknowledge.com29-Mar-07 3:53
Memberpostmaster@programmingknowledge.com29-Mar-07 3:53 
Questionplease help me with this Pin
Oga M29-Mar-07 1:57
MemberOga M29-Mar-07 1:57 
AnswerRe: please help me with this Pin
Sandeep Akhare30-Mar-07 6:08
MemberSandeep Akhare30-Mar-07 6:08 
QuestionWeek-Number Pin
Oga M29-Mar-07 1:53
MemberOga M29-Mar-07 1:53 
AnswerRe: Week-Number Pin
postmaster@programmingknowledge.com29-Mar-07 4:01
Memberpostmaster@programmingknowledge.com29-Mar-07 4:01 
Questionasp.net and sql loader Pin
chitra8129-Mar-07 1:51
Memberchitra8129-Mar-07 1:51 
AnswerRe: asp.net and sql loader Pin
gauthee29-Mar-07 4:10
Membergauthee29-Mar-07 4:10 
GeneralRe: asp.net and sql loader Pin
chitra8129-Mar-07 19:13
Memberchitra8129-Mar-07 19:13 
GeneralRe: asp.net and sql loader Pin
gauthee30-Mar-07 21:15
Membergauthee30-Mar-07 21:15 
GeneralRe: asp.net and sql loader Pin
chitra8130-Mar-07 21:34
Memberchitra8130-Mar-07 21:34 
GeneralRe: asp.net and sql loader Pin
gauthee2-Apr-07 3:40
Membergauthee2-Apr-07 3:40 
GeneralRe: asp.net and sql loader Pin
chitra813-Apr-07 19:29
Memberchitra813-Apr-07 19:29 
AnswerRe: Datagrid with session problem Pin
_AK_29-Mar-07 2:10
Member_AK_29-Mar-07 2:10 
QuestionCall button_click code from another page Pin
Alice@mywonderland29-Mar-07 1:39
MemberAlice@mywonderland29-Mar-07 1:39 
QuestionPlease help me on Printing a document.....? Pin
fmlove29-Mar-07 1:33
Memberfmlove29-Mar-07 1:33 
AnswerRe: Please help me on Printing a document.....? Pin
_AK_29-Mar-07 1:34
Member_AK_29-Mar-07 1:34 

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.