Simple SQL query with DataContext

I have a web-site connected to a SQL Server database, and I want to add a simple SQL query to it (for administrators). I was hoping to use the DataContext, and run a query, then return the results as a simple list. Is there any way to do this?

Using

                string full_query = "SELECT " + query;
            IEnumerable<string> results = DB.DB().ExecuteQuery<string>(full_query);

Doesn’t work, throwing errors where ints come through. Changing the template parameter to “object” doesn’t help much either.

read more

Simple SQL query with DataContext

I have a web-site connected to a SQL Server database, and I want to add a simple SQL query to it (for administrators). I was hoping to use the DataContext, and run a query, then return the results as a simple list. Is there any way to do this?

Using

                string full_query = "SELECT " + query;
            IEnumerable<string> results = DB.DB().ExecuteQuery<string>(full_query);

Doesn’t work, throwing errors where ints come through. Changing the template parameter to “object” doesn’t help much either.

read more

How to place a posted value in a textbox

Here in click.html,OnClick of clint_ip text box is redirecting to index.html.There we will select some client_ip’s .After hitting the submit button in the index.html,I’m able to retrieve the values in the click.html.But I’m unable to keep the retrieved value into the client_ip textbox of click.html.I’m able to get the values in the “res” variable.

My click.html

<html>
<head>
 <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>

<script type="text/javascript" src="http://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script>

<script type="text/javascript" src="https://raw.githubusercontent.com/mpryvkin/Plugins/master/pagination/simple_numbers_no_ellipses.js"></script>

<link rel='stylesheet' href='style.css'>
<link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.9/css/jquery.dataTables.min.css">
</head>
<body>
<div id="clicDiv">
Client IP :<input type="text" id="ipClick"  onclick="getValue();" name="Client IP" />
</div>
<script>


function getUSERIP(){

if(!window.location.href.match(/client_ip=.*?([^\&])/))
   return;

var ip = window.location.href.match(/client_ip=.*?([^\&])/)[0].replace('client_ip=','');


$("#ipClick").val(ip);

}
getUSERIP();

function getValue(){
location.href='/home/divya/html_docs/index.html';

}
</script>
</body>
</html>

read more