Archive for March, 2006

Ajax simpleeee….

Here is my simple ajax code…..

 

var req = new XMLHttpRequest();
req.open(”GET”, “test.html”,true);
req.onreadystatechange = function () {
document.getElementById(’divTxt’).innerHTML = “Contents : ” + req.responseText;
}
req.send(null);

HTML Source - test.html

apple
orange
pencil
box
bottle
computer
cat
dog
fox
windows
linux
unix
freebsd
blah

This code is compatible with Mozilla based browsers only. Eg: Firefox for windows
VN:F [1.1.6_502]Rating: 2.0/5 (1 vote cast)

Leave a Comment

Get all table names from Microsoft Access (MDB) database file

con.Open();
DataTable dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] {null, null, null, “TABLE”});
for (int i=0;i< dt.Rows.Count;i++)
{
MessageBox.Show( dt.Rows[i]["TABLE_NAME"].ToString());
}
con.Close();

VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

Simple Paging feature with PHP and MySQL

This is not a full-featured code, but you can develop it to one.
Simple Paging feature with PHP and MySQL

< _?php
$db = mysql_connect("localhost","root");
mysql_select_db("test");
$pagesize = 2;
$res = mysql_query("select *from test");
$totalrecs = mysql_num_rows($res);
if (!isset($firstrec)) $firstrec = 0;
if (isset($_REQUEST['action'])) {
$firstrec = $_REQUEST['firstrec'];
switch ($_REQUEST['action']) {
case "prev":
if ($firstrec > 0)
$firstrec-= $pagesize ;
break;
case “next”:
if ($firstrec < $totalrecs-$pagesize )
$firstrec+=$pagesize;
break;
}
}
$res = mysql_query(”select *from [...]

Leave a Comment

Return multiple values from a function

private void test(out string test1, out string test2)
{
test1 = “hello”;
test2 = “world”;
}
test(out a, out b);
Text = a + ” ” + b;

VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

Sorry, I will be back soon.

I am too busy with some projects now. So not getting time to update my blog.
Sure, I will come back soon.
VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment