Click here to Skip to main content
15,174,232 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to get the STock ticker from Indian Share market ?? Pin
R. Giskard Reventlov1-Apr-10 21:32
MemberR. Giskard Reventlov1-Apr-10 21:32 
AnswerRe: How to get the STock ticker from Indian Share market ?? Pin
MyDevBank2-Apr-10 1:22
MemberMyDevBank2-Apr-10 1:22 
QuestionASP.Net and Oracle Problem Pin
CrazyCoder261-Apr-10 20:24
MemberCrazyCoder261-Apr-10 20:24 
Questioncode of friends Pin
sweta24081-Apr-10 20:04
Membersweta24081-Apr-10 20:04 
AnswerRe: code of friends Pin
Muhammad Gouda2-Apr-10 5:52
MemberMuhammad Gouda2-Apr-10 5:52 
QuestionVideo conferencing Pin
jayprakash sir ji1-Apr-10 18:44
professionaljayprakash sir ji1-Apr-10 18:44 
Questionwhen user enter the name of category releted records should be pop up in gridview control using asp with c# Pin
developerit1-Apr-10 11:45
Memberdeveloperit1-Apr-10 11:45 
AnswerRe: when user enter the name of category releted records should be pop up in gridview control using asp with c# Pin
Alaric_1-Apr-10 11:49
professionalAlaric_1-Apr-10 11:49 
Change your TextBox to a DropDownList
Create a StoredProcedure that will return you a listing of Categories from your Category reference table
Transform the raw data into a List of KeyValuePairs with your category DisplayNames and your Database Values,
Set the DataSource of your DropDownList to the List<KeyValuePair<string,string>> where each KeyValuePair represents an individual category,
DropDownList.DataBind();
Trigger a postback on Category Selection,
Send the category down to your Stored Procedure as a parameter,
Pull back data,
perform ORM,
set the DataSource of your GridView to a List of your Business Objects
GridView.DataBind();

Done


Quick and dirty, typed in-line off top of head:
public List<KeyValuePair<string, string>> GetCategories()
{
     //Pseudo-Code
     //Open Database Connection
     //Create a command of type StoredProcedure
     //Tell the command which stored procedure to execute (preferrably, your "GetCategories() SP)
     List<KeyValuePair<string,string>> categories = new List<KeyValuePair<string,string>>();
     while(reader.Read())
     {
           categories.Add(new KeyValuePair<string,string>(reader["CategoryName"],reader["categoryID"].ToString());
     }
 return categories;
}

public List<BusinessObject> GetData(int category)
{
     //Pseudo-Code
     //Open Database Connection
     //Create a command of type StoredProcedure
     //Tell the command which stored proc to execute (preferrably, the one that "Gets Data")
     //Send category down to Stored Proc as a parameter
     List<BusinessObject> list = new List<BusinessObject>();
     while(reader.Read())
     {
          list.Add(new BusinessObject(reader["id"],reader["blahdeblah"],reader["whateverotherfieldyouwanttomap"]);
     }
     return list;
}


protected void Page_Load(object sender, EventArgs e)
{
   if(!Page.IsPostBack)
   {
      grdData.DataSource = GetData();
      grdData.DataBind();
      ddlCategories.DataSource = GetCategories();
      ddlCategories.DataTextField = "Key";
      ddlCategories.DataValueField = "Value";
      ddlCategories.DataBind();
   }
}

"I need build Skynet. Plz send code"

Questionhow to calculate total in a gridview dynamically Pin
developerit1-Apr-10 11:39
Memberdeveloperit1-Apr-10 11:39 
AnswerRe: how to calculate total in a gridview dynamically Pin
Alaric_1-Apr-10 11:44
professionalAlaric_1-Apr-10 11:44 
Questionhow to transfer data from one page gridview to anothe page gridview Pin
developerit1-Apr-10 11:37
Memberdeveloperit1-Apr-10 11:37 
AnswerRe: how to transfer data from one page gridview to anothe page gridview Pin
Alaric_1-Apr-10 11:43
professionalAlaric_1-Apr-10 11:43 
AnswerRe: how to transfer data from one page gridview to anothe page gridview Pin
jayprakash sir ji1-Apr-10 18:47
professionaljayprakash sir ji1-Apr-10 18:47 
QuestionProblem: Quirky Problem with Javascript OnClick chaining - Server code executed | Client code ignored (C# 3.5) Pin
Alaric_1-Apr-10 11:32
professionalAlaric_1-Apr-10 11:32 
AnswerRe: want to clear oops concepts in depth Pin
Not Active1-Apr-10 9:26
mentorNot Active1-Apr-10 9:26 
AnswerRe: want to clear oops concepts in depth Pin
Alaric_1-Apr-10 12:13
professionalAlaric_1-Apr-10 12:13 
AnswerRe: want to clear oops concepts in depth Pin
Muhammad Gouda2-Apr-10 5:59
MemberMuhammad Gouda2-Apr-10 5:59 
QuestionDetect an external email address Pin
Dayekh1-Apr-10 6:01
MemberDayekh1-Apr-10 6:01 
AnswerRe: Detect an external email address Pin
JHizzle1-Apr-10 6:07
MemberJHizzle1-Apr-10 6:07 
GeneralRe: Detect an external email address Pin
Dayekh1-Apr-10 6:16
MemberDayekh1-Apr-10 6:16 
GeneralRe: Detect an external email address Pin
JHizzle1-Apr-10 6:24
MemberJHizzle1-Apr-10 6:24 
GeneralRe: Detect an external email address Pin
Dayekh1-Apr-10 6:54
MemberDayekh1-Apr-10 6:54 
Questioncross platform feature of asp.net Pin
ships_agr1-Apr-10 4:43
Memberships_agr1-Apr-10 4:43 
AnswerRe: cross platform feature of asp.net Pin
JHizzle1-Apr-10 5:04
MemberJHizzle1-Apr-10 5:04 
AnswerRe: cross platform feature of asp.net Pin
MyDevBank1-Apr-10 5:35
MemberMyDevBank1-Apr-10 5:35 

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.