Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

sql server 2008 express - SQL data retrieve - C# -


how retrieve data table within loop or something. means want retrieve row row @ time. sequence of rows may differ. example, 1st time want 5rd row,then 2nd, 9...so on.

i searched through internet. got 2 answers.

  1. use several sqlconnection objects.

  2. reader= sqlcommand.executereader(); while(reader.read()){ reader["column name"].tostring(); }

if got problem, please me thank you.

sounds should correct data layer return values in order going process them. easiest , fastest! :)

as alternative i'd suggest load result datatable:

    datatable table = new datatable();     using ( sqlcommand command = new sqlcommand() )     {            // todo: set command here         using (sqldataadapter adapter = new sqldataadapter(command))         {             adapter.fill(table);         }     }      // use datatable this...      if ( table.rows.count >= 5 ) {         datarow firstrow = table.rows[0]; // #1 row         datarow fifthrow = table.rows[4]; // #5 row         datarow secondrow = table.rows[1]; // #2 row     } 

/alex


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -