Posts

sqlite - fetch column name from json array -

i need column name json array , ccompare column name sqlite table , have alter table when column name dowsnot exists. i use code fetch column , column name sqlite code string searchquery = "select * " + mytable; cursor cursor = mydatabase.rawquery(searchquery, null ); jsonarray resultset = new jsonarray(); cursor.movetofirst(); while (cursor.isafterlast() == false) { int totalcolumn = cursor.getcolumncount(); jsonobject rowobject = new jsonobject(); for( int i=0 ; i< totalcolumn ; i++){ cursor.getcolumnname(i); here use "cursor.getcolumnname() " column name sqlitetable. like this possible fetch column name jsonarray example cursor.getcolumnname(resultset.getjsonarray(i); is possible, else give me solution column name of jsonarray value. have compare column names of jsonarray , sqlite table.

sql server - Extract Data from running dataset -

i've had minor crisis sql server, involving large portion of data being removed. luckily, application wrote using dataset pull data server, , still has of old data. there way can extract data rentry database? must done application running, opening new instance pulls new data database... my google-fu has turned nothing, particular problem have. appreciated. apologies questionable tags, hard see fits. edit: clarify confusion found in comments, data absolutely within application, closing cause loss of data. copying data ui i'm trying avoid here...as massively time consuming. thank again help, appreciated.

c# - Bind/Display the two different columns data together inside a Dropdown for a particluar Id in "Edit" mode of RadGrid -

i have 4 columns in telerik radgrid 1) account code (only column shown in "edit" , "add" mode - dropdown) 2) account description 3) amount 4) remark below "add" mode code using: html code: <mastertableview showheaderswhennorecords="true" autogeneratecolumns="false" datakeynames="accountcodeid" insertitemdisplay="top" insertitempageindexaction="showitemoncurrentpage" showfooter="true" commanditemdisplay="top"> <columns> <telerik:grideditcommandcolumn></telerik:grideditcommandcolumn> <telerik:gridtemplatecolumn uniquename="accountcode" headertext="account code"> <itemtemplate> <asp:label...

c# - ADO.net Entity Data Model from SQL Server -

i trying create entity data model sql server database using ado.net in visual studio 2012 , facing error key (primary , foreign): the table/view 'database.tablename' not have primary key defined. key has been inferred , definition created read-only table/view. is there me solving problem? thanks.

JavaScript closure inside loops – simple practical example -

var funcs = []; (var = 0; < 3; i++) { // let's create 3 functions funcs[i] = function() { // , store them in funcs console.log("my value: " + i); // each should log value. }; } (var j = 0; j < 3; j++) { funcs[j](); // , let's run each 1 see } it outputs this: my value: 3 value: 3 value: 3 whereas i'd output: my value: 0 value: 1 value: 2 what's solution basic problem? well, problem variable i , within each of anonymous functions, bound same variable outside of function. what want bind variable within each function separate, unchanging value outside of function: var funcs = []; function createfunc(i) { return function() { console.log("my value: " + i); }; } (var = 0; < 3; i++) { funcs[i] = createfunc(i); } (var j = 0; j < 3; j++) { funcs[j](); // , let's run each 1 see } ...

perl - Why do I get "HASH(0x1cbf850)" when I try to print a value from my YAML file? -

i'm trying read yaml file following code: #!/usr/bin/perl use strict; use warnings; use data::dumper; use mime::base64; use yaml qw(loadfile); $set = loadfile('/apps/config/config.yml'); print $set->{appbaseurl}; my config file looks this: dev: &dev appbaseurl: "https://app-dev:8443" appusername: devadmin apppassword: ffaljfdlsd stage: &stage appbaseurl: "https://app-stg" appusername: stageadmin apppassword: jljfaldskels" when print $set->{appbaseurl}; get hash(0x1cbf850) which not expected. why?

asp.net mvc - Why can't one Razor helper call another helper? -

i'm running razor code below in .cshtml file (it's simplified version of more complex need achieve), rendertestb helper not seem execute. @rendertesta("test string 1", "test string 2"); @helper rendertesta(string input1, string input2) { <div> @rendertestb(input1) @rendertestb(input2) </div> } @helper rendertestb(string input) { <p class="test">@input</p> } why this? , there way of achieving i'm trying do? i realise duplicate paragraph code within rendertesta helper, prefer re-usable code solution. what this? @rendertesta(rendertestb("test string 1"), rendertestb("test string 2")) @helper rendertesta(string input1, string input2) { <div> @input1 @input2 </div> } @helper rendertestb(string input) { <p class="test">@input</p> } you should consider using editor / display templates or cus...