7
Posted on 4:17 AM by prajeesh and filed under ,
Sometimes you may be want to show your latest twitter tweets in your website or blog, most of the cases you are doing this by using widgets with limited customization facilities and showing ads or links to other websites, here is an easier way to achieve this using twitter API and javascript.
Step 1:
First, decide where about on your page you want your last tweet to display. Then paste following html code there.
Step 2:
Next you need to put these 2 lines of JavaScript below the code in step 1. On the 2nd line of code where it says prajeeshkk.json, you need to replace prajeeshkk with your twitter username.

Step 3:(Optional)
You can apply css and make the div displaying the tweet stylish.


See how my tweet design looks :

Shout it kick it on DotNetKicks.com
0
Posted on 4:06 AM by prajeesh and filed under ,
In some applications we may need to reset all controls in using a single "Reset" button click, here is the c# code to achieve this.

public static void ResetControls(ControlCollection pagecontrols, bool txtbox, bool dropdownlist, bool label)
{
foreach (Control cntrl in pagecontrols)
{
foreach (Control mycontrols in cntrl.Controls)
{
if (txtbox)
{
if (mycontrols is TextBox)
{
(mycontrols as TextBox).Text = string.Empty;
}
}
if (dropdownlist)
{
if (mycontrols is DropDownList)
{
(mycontrols as DropDownList).SelectedIndex = 0;
}
}
if (label)
{
if (mycontrols is Label)
{
(mycontrols as Label).Text = string.Empty;
}
}
}
}
}

We can call this function using following format if you want to clear all controls except label

FormControl.ResetControls(this.Controls, true, true, false);

Shout it kick it on DotNetKicks.com
0
Posted on 8:54 AM by prajeesh and filed under
Sometimes you may need to update an online database with some stored procedure you have modified in your local system, but in most of the cases you may be confused about what are the stored procedures or tables you modified last, here is a quick solution for this.
1.Query to sort Stored Procedures on modified date.

SELECT name, create_date, modify_date,type
FROM sys.objects
WHERE type = 'P' order by modify_date desc

2.Query to sort Stored Procedures on created date

SELECT name, create_date, modify_date,type
FROM sys.objects
WHERE type = 'P' order by create_date desc

3.Query to sort user defined tables on created date

SELECT name, create_date, modify_date,type
FROM sys.objects
WHERE type = 'u' order by create_date desc

4.Query to sort user defined tables on modified date

SELECT name, create_date, modify_date,type
FROM sys.objects
WHERE type = 'u' order by modify_date desc
Shout it kick it on DotNetKicks.com