Click here to Skip to main content
15,867,453 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Server Error in '/aspx' Application. Pin
nothingbutcat29-Mar-07 6:50
nothingbutcat29-Mar-07 6:50 
QuestionAjax control doesn't work in Firefox and other computers? Pin
Abubakarsb29-Mar-07 4:49
Abubakarsb29-Mar-07 4:49 
QuestionSSL ERROR Pin
lajith29-Mar-07 3:05
lajith29-Mar-07 3:05 
Questionhow to generate reprot using sql server 2000 reporting service Pin
mohd imran abdul aziz29-Mar-07 2:37
mohd 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
Oga M29-Mar-07 2:04 
AnswerRe: Display a project member in the listbox Pin
Tirthadip29-Mar-07 2:44
Tirthadip29-Mar-07 2:44 
AnswerRe: Display a project member in the listbox Pin
Naveed Kamboh29-Mar-07 2:48
Naveed 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
postmaster@programmingknowledge.com29-Mar-07 3:53 
Questionplease help me with this Pin
Oga M29-Mar-07 1:57
Oga M29-Mar-07 1:57 
AnswerRe: please help me with this Pin
Sandeep Akhare30-Mar-07 6:08
Sandeep Akhare30-Mar-07 6:08 
QuestionWeek-Number Pin
Oga M29-Mar-07 1:53
Oga M29-Mar-07 1:53 
AnswerRe: Week-Number Pin
postmaster@programmingknowledge.com29-Mar-07 4:01
postmaster@programmingknowledge.com29-Mar-07 4:01 
Questionasp.net and sql loader Pin
chitra8129-Mar-07 1:51
chitra8129-Mar-07 1:51 
AnswerRe: asp.net and sql loader Pin
gauthee29-Mar-07 4:10
gauthee29-Mar-07 4:10 
GeneralRe: asp.net and sql loader Pin
chitra8129-Mar-07 19:13
chitra8129-Mar-07 19:13 
GeneralRe: asp.net and sql loader Pin
gauthee30-Mar-07 21:15
gauthee30-Mar-07 21:15 
GeneralRe: asp.net and sql loader Pin
chitra8130-Mar-07 21:34
chitra8130-Mar-07 21:34 
GeneralRe: asp.net and sql loader Pin
gauthee2-Apr-07 3:40
gauthee2-Apr-07 3:40 
GeneralRe: asp.net and sql loader Pin
chitra813-Apr-07 19:29
chitra813-Apr-07 19:29 
AnswerRe: Datagrid with session problem Pin
_AK_29-Mar-07 2:10
_AK_29-Mar-07 2:10 
QuestionCall button_click code from another page Pin
Alice@mywonderland29-Mar-07 1:39
Alice@mywonderland29-Mar-07 1:39 
QuestionPlease help me on Printing a document.....? Pin
fmlove29-Mar-07 1:33
fmlove29-Mar-07 1:33 
AnswerRe: Please help me on Printing a document.....? Pin
_AK_29-Mar-07 1:34
_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.