Click here to Skip to main content
11,705,610 members (46,138 online)
   

C#

 
GeneralRe: Reading jpeg image from a binary data Pin
OriginalGriff14-Jan-13 21:03
mvpOriginalGriff14-Jan-13 21:03 
QuestionCapturing windows messages Pin
Dainer Mesa Lima13-Jan-13 19:45
memberDainer Mesa Lima13-Jan-13 19:45 
AnswerRe: Capturing windows messages Pin
Sandeep Mewara13-Jan-13 20:23
mvpSandeep Mewara13-Jan-13 20:23 
AnswerRe: Capturing windows messages Pin
Pete O'Hanlon13-Jan-13 23:29
protectorPete O'Hanlon13-Jan-13 23:29 
QuestionSqlConnection vs IDbConnection Pin
levanduyet_vn13-Jan-13 15:40
memberlevanduyet_vn13-Jan-13 15:40 
AnswerRe: SqlConnection vs IDbConnection Pin
PIEBALDconsult13-Jan-13 15:56
memberPIEBALDconsult13-Jan-13 15:56 
AnswerRe: SqlConnection vs IDbConnection Pin
Simon_Whale14-Jan-13 0:01
memberSimon_Whale14-Jan-13 0:01 
QuestionLINQ with List Pin
Member 873185913-Jan-13 9:48
memberMember 873185913-Jan-13 9:48 
AnswerRe: LINQ with List Pin
J4amieC13-Jan-13 21:47
memberJ4amieC13-Jan-13 21:47 
AnswerRe: LINQ with List Pin
Simon_Whale14-Jan-13 1:17
memberSimon_Whale14-Jan-13 1:17 
GeneralRe: LINQ with List Pin
Member 875312115-Jan-13 6:35
memberMember 875312115-Jan-13 6:35 
AnswerRe: LINQ with List Pin
Member 873185921-Jan-13 6:36
memberMember 873185921-Jan-13 6:36 
Questionhow i get data from datatable Pin
a1_shay13-Jan-13 6:58
membera1_shay13-Jan-13 6:58 
AnswerRe: how i get data from datatable Pin
PIEBALDconsult13-Jan-13 13:38
memberPIEBALDconsult13-Jan-13 13:38 
I can't quite tell what you are trying to do there, but (dt is a DataTable, right?) you could try:

dt.DefaultView.RowFilter = "area=" + areaname ;
DropDownList2.DataSource = dt.DefaultView ;

Edit: Here's a full working example.

            System.Data.DataRow dr ;
 
// Define a State table
            System.Data.DataTable state = new System.Data.DataTable("State");
            state.Columns.Add(new System.Data.DataColumn("ID",typeof(int)));
            state.Columns.Add(new System.Data.DataColumn("Name",typeof(string)));
 
// Add some rows
            dr = state.NewRow() ;
            dr [ "ID" ] = 1 ;
            dr [ "Name" ] = "Arizona" ;
            state.Rows.Add ( dr ) ;
 
            dr = state.NewRow() ;
            dr [ "ID" ] = 2 ;
            dr [ "Name" ] = "California" ;
            state.Rows.Add ( dr ) ;
 
// Set the first ComboBox to display the table
            this.comboBox1.DataSource = state.DefaultView ;
            this.comboBox1.DisplayMember = "Name" ;
 
// Define a City table
            System.Data.DataTable city = new System.Data.DataTable("State");
            city.Columns.Add(new System.Data.DataColumn("ID",typeof(int)));
            city.Columns.Add(new System.Data.DataColumn("State",typeof(int)));
            city.Columns.Add(new System.Data.DataColumn("Name",typeof(string)));
 
// Add some rows
            dr = city.NewRow() ;
            dr [ "ID" ] = 1 ;
            dr [ "State" ] = 1 ;
            dr [ "Name" ] = "Phoenix" ;
            city.Rows.Add ( dr ) ;
 
            dr = city.NewRow() ;
            dr [ "ID" ] = 2 ;
            dr [ "State" ] = 1 ;
            dr [ "Name" ] = "Tucson" ;
            city.Rows.Add ( dr ) ;
 
            dr = city.NewRow() ;
            dr [ "ID" ] = 3 ;
            dr [ "State" ] = 2 ;
            dr [ "Name" ] = "San Diego" ;
            city.Rows.Add ( dr ) ;
 
            dr = city.NewRow() ;
            dr [ "ID" ] = 4 ;
            dr [ "State" ] = 2 ;
            dr [ "Name" ] = "Los Angeles" ;
            city.Rows.Add ( dr ) ;
 
// Set the second ComboBox to display the table
            this.comboBox2.DataSource = city.DefaultView ;
            this.comboBox2.DisplayMember = "Name" ;
 
// Add a SelectedIndexChanged handler
            this.comboBox1.SelectedIndexChanged += delegate ( object sender , System.EventArgs e )
            {
                System.Data.DataRowView item = this.comboBox1.SelectedItem as System.Data.DataRowView ;
 
                city.DefaultView.RowFilter = "State=" + item [ "ID" ] ;
 
                return ;
            } ;
 
// Select the first State
            this.comboBox1.SelectedIndex = 0 ;


modified 14-Jan-13 9:49am.

GeneralRe: how i get data from datatable Pin
a1_shay13-Jan-13 20:29
membera1_shay13-Jan-13 20:29 
GeneralRe: how i get data from datatable Pin
Mycroft Holmes13-Jan-13 21:06
memberMycroft Holmes13-Jan-13 21:06 
GeneralRe: how i get data from datatable Pin
a1_shay13-Jan-13 21:08
membera1_shay13-Jan-13 21:08 
GeneralRe: how i get data from datatable Pin
Mycroft Holmes13-Jan-13 23:58
memberMycroft Holmes13-Jan-13 23:58 
GeneralRe: how i get data from datatable Pin
a1_shay14-Jan-13 0:53
membera1_shay14-Jan-13 0:53 
GeneralRe: how i get data from datatable Pin
PIEBALDconsult14-Jan-13 3:05
memberPIEBALDconsult14-Jan-13 3:05 
GeneralRe: how i get data from datatable Pin
a1_shay14-Jan-13 3:08
membera1_shay14-Jan-13 3:08 
GeneralRe: how i get data from datatable Pin
PIEBALDconsult14-Jan-13 3:36
memberPIEBALDconsult14-Jan-13 3:36 
GeneralRe: how i get data from datatable Pin
a1_shay14-Jan-13 12:34
membera1_shay14-Jan-13 12:34 
Questionis it possible to work with Word files using Binary Reader and writer? Pin
asem052513-Jan-13 5:41
memberasem052513-Jan-13 5:41 
AnswerRe: is it possible to work with Word files using Binary Reader and writer? Pin
Garth J Lancaster13-Jan-13 10:19
memberGarth J Lancaster13-Jan-13 10:19 
QuestionDeleting registry values Pin
Erol230913-Jan-13 4:51
memberErol230913-Jan-13 4:51 
AnswerRe: Deleting registry values Pin
ProgramFOX13-Jan-13 6:06
member ProgramFOX13-Jan-13 6:06 
GeneralRe: Deleting registry values Pin
Erol230913-Jan-13 8:44
memberErol230913-Jan-13 8:44 
GeneralRe: Deleting registry values Pin
ProgramFOX14-Jan-13 5:57
member ProgramFOX14-Jan-13 5:57 
AnswerRe: Deleting registry values Pin
Pete O'Hanlon13-Jan-13 8:56
protectorPete O'Hanlon13-Jan-13 8:56 
GeneralRe: Deleting registry values Pin
Erol230913-Jan-13 22:17
memberErol230913-Jan-13 22:17 
GeneralRe: Deleting registry values Pin
jibesh13-Jan-13 22:32
memberjibesh13-Jan-13 22:32 
GeneralRe: Deleting registry values Pin
Pete O'Hanlon13-Jan-13 23:40
protectorPete O'Hanlon13-Jan-13 23:40 
QuestionIndex was outside the bounds of the array. Pin
Erol230913-Jan-13 4:11
memberErol230913-Jan-13 4:11 
AnswerRe: Index was outside the bounds of the array. Pin
OriginalGriff13-Jan-13 4:15
mvpOriginalGriff13-Jan-13 4:15 
GeneralRe: Index was outside the bounds of the array. Pin
Erol230913-Jan-13 4:17
memberErol230913-Jan-13 4:17 
GeneralRe: Index was outside the bounds of the array. Pin
OriginalGriff13-Jan-13 4:21
mvpOriginalGriff13-Jan-13 4:21 
AnswerRe: Index was outside the bounds of the array. Pin
PIEBALDconsult13-Jan-13 4:41
memberPIEBALDconsult13-Jan-13 4:41 
QuestionObject reference not set to an instance of an object Pin
Erol230912-Jan-13 19:25
memberErol230912-Jan-13 19:25 
AnswerRe: Object reference not set to an instance of an object Pin
jibesh12-Jan-13 19:41
memberjibesh12-Jan-13 19:41 
QuestionSaving selected option into database Pin
Oyebisi Jemil12-Jan-13 11:31
memberOyebisi Jemil12-Jan-13 11:31 
AnswerRe: Saving selected option into database Pin
Pete O'Hanlon12-Jan-13 11:45
protectorPete O'Hanlon12-Jan-13 11:45 
AnswerRe: Saving selected option into database Pin
Dave Kreskowiak12-Jan-13 12:48
mvpDave Kreskowiak12-Jan-13 12:48 
GeneralRe: Saving selected option into database Pin
Brisingr Aerowing12-Jan-13 13:49
memberBrisingr Aerowing12-Jan-13 13:49 
GeneralRe: Saving selected option into database Pin
PIEBALDconsult12-Jan-13 15:22
memberPIEBALDconsult12-Jan-13 15:22 
QuestionBinary Reader Pin
dxtrx12-Jan-13 10:38
memberdxtrx12-Jan-13 10:38 
AnswerRe: Binary Reader Pin
jibesh12-Jan-13 13:01
memberjibesh12-Jan-13 13:01 
GeneralRe: Binary Reader Pin
dxtrx12-Jan-13 13:17
memberdxtrx12-Jan-13 13:17 
GeneralRe: Binary Reader Pin
Brisingr Aerowing12-Jan-13 13:48
memberBrisingr Aerowing12-Jan-13 13:48 
QuestionSocket programming- Response to all client Pin
mohammadkaab12-Jan-13 7:36
membermohammadkaab12-Jan-13 7:36 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 29 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid