Wednesday, March 13, 2013
Sunday, March 10, 2013
C# + SQL Example #1
* Gets max row count
* Inserts a new row (value number greater than max rows)
* Displays row values
[CODE]
string connString = "Server=localhost;Database=cshptest;Uid=root;"; // Select DB
MySqlConnection conn = new MySqlConnection(connString);
MySqlCommand command = conn.CreateCommand();
// Command to count the rows
conn.Open();
command.CommandText = "SELECT COUNT(*) FROM csdat";
int rows = Convert.ToInt32(command.ExecuteScalar());
int newrows = rows + 1;
conn.Close();
// Insert a new data row, with the value greater than last index value (ex. 5 + 1 = 6)
command.CommandText = "Insert into csdat (id,dataT) values('" + newrows + "','" + newrows + "');";
conn.Open();
command.ExecuteNonQuery();
conn.Close();
MySqlDataReader reader;
// Read data in each row
for (int i = 0; i <= rows; i++)
{
string cnt = i.ToString();
conn.Open();
command.CommandText = "Select dataT from csdat where id=" + cnt; // Select column from table
reader = command.ExecuteReader();
while (reader.Read())
{
MessageBox.Show(reader["dataT"].ToString()); // extract data from column
}
conn.Close();
}
[/CODE]
* Inserts a new row (value number greater than max rows)
* Displays row values
[CODE]
string connString = "Server=localhost;Database=cshptest;Uid=root;"; // Select DB
MySqlConnection conn = new MySqlConnection(connString);
MySqlCommand command = conn.CreateCommand();
// Command to count the rows
conn.Open();
command.CommandText = "SELECT COUNT(*) FROM csdat";
int rows = Convert.ToInt32(command.ExecuteScalar());
int newrows = rows + 1;
conn.Close();
// Insert a new data row, with the value greater than last index value (ex. 5 + 1 = 6)
command.CommandText = "Insert into csdat (id,dataT) values('" + newrows + "','" + newrows + "');";
conn.Open();
command.ExecuteNonQuery();
conn.Close();
MySqlDataReader reader;
// Read data in each row
for (int i = 0; i <= rows; i++)
{
string cnt = i.ToString();
conn.Open();
command.CommandText = "Select dataT from csdat where id=" + cnt; // Select column from table
reader = command.ExecuteReader();
while (reader.Read())
{
MessageBox.Show(reader["dataT"].ToString()); // extract data from column
}
conn.Close();
}
[/CODE]
Sunday, February 24, 2013
So What Happened to John McAfee..?
As far as I've heard, he's back in US after long cross-country run, from the police. If you don't know already, he was the suspect (or the "man of interest") of killing his neighbor at one of the islands in Belize, where his luxury home is located. After the neighbor's death, he was on the run in disguise.
Here's the latest story:
So he has running loose for five weeks throughout central america. Finally he emerged out of Oregon. At this point, he spread a fake news through the net that he was captured in Mexico, and fled to Guatemala. When he was asked why he was fleeing, his response was: "As a 'person of interest', you have to come to there offices -- which are in the mass of the prison complex -- to talk to you. And in Belize, they can detain you for 30 days with no charges what so ever..". When he was asked who killed his neighbor, the response: "I don't know, in Belize murder is happening all the time." And he says that the Belize police was out to get him, because of his open criticism of the Belize police corruption, and the police deliberately killed the man to get to him.
Also he likes to often speak about his sexual prowess: "People ask me, 'You really slept with 10 17 year girls?' And i'm a 67 years old man, and I say 'Yup, i did'. There's no point in not telling the truth now, no point now in dancing around it."
"John with his current young girl friend, who he intend to get married (December, 2012)"
But unexpectedly, in a press conference at Guatemala, McAfee get's arrested by the police.
And now, the news of the murder is all covered up by the talks about his various exploits...
Tuesday, January 29, 2013
Monday, December 3, 2012
Monday, November 19, 2012
Wednesday, October 31, 2012
GeoSoft Update
We are in the process of completing the POS system and the Inventory Control system requested by "Sisira Motors" (Dambulla branch). We are currently schedule for the 2nd system assessment with the client on next Tuesday.
Friday, October 26, 2012
GeoSoft Update:
GeoSoft Update:
The Inventory Control Software project we've undertaken for Darshana Engineers Pvt Ltd. has completed and installed on Client's location (Darshana Eng branch, Wehara, Kurunegala) about a month ago. The system's Beta testing period is yet ongoing. And we are providing continuous customer care online.
The Inventory Control Software project we've undertaken for Darshana Engineers Pvt Ltd. has completed and installed on Client's location (Darshana Eng branch, Wehara, Kurunegala) about a month ago. The system's Beta testing period is yet ongoing. And we are providing continuous customer care online.
Friday, October 12, 2012
Movies Library for Movies Rental Shop (MS Windows) v1.0 (c) 2012 Kasun Liyanage
Movies Library for Movies Rental Shop (MS Windows) v1.0
(c) 2012 Kasun Liyanage
Download, Extract, and Run "DVDShopNonEDM.exe". Enjoy!
Note: You need .NET framework installed to run it
DOWNLOAD
(c) 2012 Kasun Liyanage
Download, Extract, and Run "DVDShopNonEDM.exe". Enjoy!
Note: You need .NET framework installed to run it
DOWNLOAD
Subscribe to:
Posts (Atom)
-
S o you wanna learn the basics of C# database programming? Then read along this booklet, and you’ll learn how to build your own data...














