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.

select - Why is TOAD faster than my java code? -


i want execute select query , able count of results, without using "count(*)", toad does. concept give option user input 'select query' wants , count number of results him.

try {    selectstatement = globalconnection.createstatement(resultset.type_scroll_insensitive, resultset.concur_read_only);    resultset selectresultset = selectstatement.executequery(selectstatementstring);    selectresultset.last();    int countofresults = selectresultset.getrow();    writeinlabel(kllstatuslabel, "count finished: found " + countofresults + " inserts"); } catch (sqlexception ex) {    writeinlabel(kllstatuslabel, "error executing select query."); } 

this code delays in line: "selectresultset.last();". toad less delay. (right-click -> record count). when scroll results table way down in toad faster.

how toad record count?

ok got it, use count(*) , have second resultset show results.

resultset selectresultset = selectstatement.executequery("select count(*) (" + selectstatementstring + ")"); int countofresults = 0; if (selectresultset.next()){    countofresults = selectresultset.getint(1); } 

toad selecting @@rowcount or other db specific result metadata. if want size of result, ask db explicitly (with count())

if you're using mysql can use row_count().


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 -