Posts

c# - How to connection string in web.config from databases names in dropdown -

i have dropdown has list of databases. user has select database has use , gridview shown. so display gridview i'm giving below connection string in code behind file. using (sqlconnection con = new sqlconnection(@"data source=hki-d-sql05\sql2k12;initial catalog=" + dropdownlist1.selectedvalue + ";user id=sa;password=sa123")) but there anyways list connection string in web.congfig file? database name has selected in code behind. means server name, user id , password can given in web config initial catalog in code behind. you can use placeholder database name in web.config (e.g. " data source=hki-d-sql05\sql2k12;initial catalog={{placeholder}};user id=sa;password=sa123 "). in code behind connection string value web.config , replace placeholder selected database (using .replace("{{placeholder}}", dropdownlist1.selectedvalue) ).

.htaccess - simple "Up a directory" button in htaccess? -

a while ago using htaccess display files, , started project again , found had somehow deleted "go level" button then. can tell me code line in htaccess looks button back? should relatively simple cant find it... heres got. options +indexes # directory customization <ifmodule mod_autoindex.c> indexoptions ignorecase fancyindexing foldersfirst namewidth=* descriptionwidth=* suppresshtmlpreamble # set display order indexorderdefault descending name # specify header file headername /partials/header.html # specify footer file readmename /partials/footer.html # ignore these files, hide them in directory indexignore .. indexignore header.html footer.html icons # ignore these files indexignore header.html footer.html favicon.ico .htaccess .ftpquota .ds_store icons *.log *,v *,t .??* *~ *# # default icon defaulticon /icons/generic.gif addicon /icons/dir.gif ^^directory^^ addicon /icons/pdf.gif .txt .pdf addicon /icons/back.png .. </ifmodule> options -i...

Error when trying to install PHP curl - Ubuntu 14.10 -

when try run sudo apt-get install php5-curl i error php5-curl : depends: php5-common (= 5.5.9+dfsg-1ubuntu4.14) 5.5.12+dfsg-2ubuntu4.6 installed what mean , how fix it? apt-get install php5 (or php5-core or php5-common) apt-get install php5-curl

android - Realm with RxAndroid not picking up latest data changes -

i using realm rxandroid. having strange issue realm not picking latest modification done on db. there 2 methods using. observable<integer> save(bitmap bitmap). observable<integer> getimagelist(context applicationcontext). like this activity 1 getimagelist(applicationcontext) button click -> activity 2 save(bitmap) finish() getimagelist(applicationcontext) this method "save" adds newly created model realmlist. private observable<integer> save(bitmap bitmap) { return observable.create((observable.onsubscribe<integer>) subscriber -> { -------------------------------------- -----various file creation stuff------ -------------------------------------- userimagesmodel model = realm .where(userimagesmodel.class) .findfirst(); //imagemodel class extends realmobject imagemodel imagemodel = new imagemodel(); ...

javascript - Construct function from strings -

this question has answer here: javascript property access: dot notation vs. brackets? 10 answers i wondering if possible. let's use 'canvas' example: (function(){ function canvas(canvas){ this.canvas = document.queryselector('#canvas'); this.ctx = this.canvas.getcontext('2d'); this.testmethod('fillrect',[10,10,10,10]); } canvas.prototype.testmethod = function(method,params){ this.method = method; this.params = params; this.ctx.method.apply(this.ctx, params); } var canvas = new canvas(); })() <canvas id='canvas' width=400 height=400></canvas> of course doesn't work wonder if it's possible dynamically construct functions in way. achive sort of user interface input method name , parameters , executed in specific context (canvasrenderingcontext2d in particular example) ...

javascript - AnyChart APEX5 Integration -

Image
i'm developing web page apex 5. want show anychart of type, not included in apex chart region options, e.g. area charts or marker charts. i've had multiple ideas, couldn't make work. has succeeded in showing custom anycharts in apex pages of standard anychart javascript api or xml? i tried both xml , javascript, called dynamic action on page load. couldn't find right configuration, never worked. glad if has example of functioning anychart integration, i'd know place , when. we use custom anychart xml on of our diagrams. use application proccesses. html code: <span id="chartspan"> </span> the js code following: for adding element (change paths accordingly): var chart = new anygantt('/i422/flashchart/anygantt_4/swf/anygantt.swf'); chart.addeventlistener('resourceselect', onresourceselect); chart.addeventlistener('periodselect', onperiodselect); chart.addeventlistener('periodeditingend', on...

How do I resize the combo box horizontally in python using pyqt4 -

this code i'm implementing right now, want resize combo box horizontally occupy maximum space possible. combo.resize gives me option stretch vertically. import sys pyqt4 import qtgui, qtcore class phaseone(qtgui.qwidget): def __init__(self): super(phaseone, self).__init__() self.initui() def initui(self): self.resize(350,150) self.center() self.setwindowtitle('programmer') self.setwindowflags(qtcore.qt.windowminimizebuttonhint) qtgui.qtooltip.setfont(qtgui.qfont('sansserif', 10)) btn = qtgui.qpushbutton('next', self) btn.settooltip('proceed next step') btn.resize(btn.sizehint()) btn.move(250, 110) btn = qtgui.qpushbutton('exit', self) btn.settooltip('exit application') btn.resize(btn.sizehint()) btn.move(175, 110) self.lbl = qtgui.qlabel("select programming langua...