<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Orientprogrammer&#039;s</title>
	<atom:link href="http://orientprogrammer.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://orientprogrammer.wordpress.com</link>
	<description>leading innovation............</description>
	<lastBuildDate>Fri, 14 Oct 2011 11:25:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='orientprogrammer.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Orientprogrammer&#039;s</title>
		<link>http://orientprogrammer.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://orientprogrammer.wordpress.com/osd.xml" title="Orientprogrammer&#039;s" />
	<atom:link rel='hub' href='http://orientprogrammer.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How To Get Proper Range Of Dates And Compare of Two Dates In Sqlserver 2005</title>
		<link>http://orientprogrammer.wordpress.com/2011/10/14/how-to-get-proper-range-of-dates-and-compare-of-two-dates-in-sqlserver-2005/</link>
		<comments>http://orientprogrammer.wordpress.com/2011/10/14/how-to-get-proper-range-of-dates-and-compare-of-two-dates-in-sqlserver-2005/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 11:25:42 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=453</guid>
		<description><![CDATA[declare @startDate varchar(20) declare @endDate varchar(20) set @startDate = &#8217;01/01/2008&#8242; set @endDate = &#8217;04/01/2008&#8242; SELECT min(date),max(date) FROM view_Inspections WHERE CAST(FLOOR(CAST(date AS FLOAT)) AS DATETIME) BETWEEN CAST(@startDate AS DATETIME) And CAST(@startDate AS DATETIME))<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=453&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>declare @startDate varchar(20) declare @endDate varchar(20) set @startDate = &#8217;01/01/2008&#8242; set @endDate = &#8217;04/01/2008&#8242;</p>
<p>SELECT min(date),max(date) FROM view_Inspections WHERE CAST(FLOOR(CAST(date AS FLOAT)) AS DATETIME) BETWEEN CAST(@startDate AS DATETIME) And CAST(@startDate AS DATETIME))</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/453/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=453&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2011/10/14/how-to-get-proper-range-of-dates-and-compare-of-two-dates-in-sqlserver-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>
	</item>
		<item>
		<title>How To Send PDf Attachment In Web Page Mail</title>
		<link>http://orientprogrammer.wordpress.com/2011/08/30/how-to-send-pdf-attachment-in-web-page-mail/</link>
		<comments>http://orientprogrammer.wordpress.com/2011/08/30/how-to-send-pdf-attachment-in-web-page-mail/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 05:39:43 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=448</guid>
		<description><![CDATA[Step 1 Make a New Web Site and Create A Web Page and Do Coding as below given. using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml; using Microsoft.CSharp; using System.Configuration; using System.Net.Mail; public partial class _Default : [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=448&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Step 1 Make a New Web Site and Create A Web Page and Do Coding as below given.</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Data;<br />
using System.Data.SqlClient;<br />
using System.Drawing;<br />
using System.Globalization;<br />
using System.IO;<br />
using System.Net;<br />
using System.Text;<br />
using System.Xml;<br />
using Microsoft.CSharp;<br />
using System.Configuration;<br />
using System.Net.Mail;</p>
<p>public partial class _Default : System.Web.UI.Page<br />
{<br />
private SqlCommand _cmd;<br />
private StringBuilder _strMailMessage;<br />
private MailMessage _objMailMessage;<br />
private MailAddress _objMailAddress;<br />
private NetworkCredential _objMailCredentials;<br />
private SmtpClient _objSmtpClient;<br />
private string _strMailSubject;<br />
private string[] _strVenderEmailAddressAfterSplit;<br />
private char[] _chrSplitter = { &#8216;;&#8217; };<br />
private int _intFlag;<br />
private SqlParameter[] _param;<br />
private DataSet _dsTempData;<br />
public static void WriteError(string errorMessage)<br />
{<br />
try<br />
{<br />
string path = &#8220;Error/&#8221; + DateTime.Today.ToString(&#8220;dd-MMM-yy&#8221;) + &#8220;.txt&#8221;;<br />
if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))<br />
{<br />
File.Create(System.Web.HttpContext.Current.Server.MapPath(path)).Close();<br />
}<br />
using (StreamWriter w = File.AppendText(System.Web.HttpContext.Current.Server.MapPath(path)))<br />
{<br />
w.WriteLine(&#8220;\r\nLog Entry : &#8220;);<br />
w.WriteLine(&#8220;{0}&#8221;, DateTime.Now.ToString(CultureInfo.InvariantCulture));<br />
string err = &#8220;Error in: &#8221; + System.Web.HttpContext.Current.Request.Url.ToString() +<br />
&#8220;. Error Message:&#8221; + errorMessage;<br />
w.WriteLine(err);<br />
w.WriteLine(&#8220;__________________________&#8221;);<br />
w.Flush();<br />
w.Close();<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
WriteError(ex.Message);<br />
}</p>
<p>}</p>
<p>protected void Page_Load(object sender, EventArgs e)<br />
{</p>
<p>}</p>
<p>private void Mailer()<br />
{<br />
try<br />
{</p>
<p>using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString))<br />
{<br />
if (con.State == ConnectionState.Closed)<br />
{<br />
con.Open();<br />
}</p>
<p>_param = new SqlParameter[1];<br />
_param[0] = new SqlParameter(&#8220;@strEmail&#8221;, SqlDbType.VarChar, 1000);<br />
_param[0].Direction = ParameterDirection.Output;<br />
SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, &#8220;usp_GetEmails&#8221;, _param);<br />
String strMails = Convert.ToString(_param[0].Value);<br />
if (String.IsNullOrEmpty(strMails))<br />
{</p>
<p>}<br />
else<br />
{<br />
_strMailMessage = new StringBuilder();<br />
_strMailMessage.Append(&#8220;&lt;table border=&#8217;0&#8242; style=&#8217;width: 100%;&#8217; cellpadding=&#8217;0&#8242; cellspacing=&#8217;0&#8242;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;tr&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;td style=&#8217;width: 100%;&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;span&gt;Dear Shareholder,&lt;/span&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 5.0pt; text-align: justify; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;span&gt;This is in continuation of our earlier e-mail, we are attaching herewith Annual Report of the Company for the year 2010-11.&lt;/span&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; text-align: justify; line-height: normal;tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;span&gt;The above said Annual Report has also been uploaded on company&#039;s website i.e.&lt;a href=&#8217;http://www.owmnahar.in&#8217; target=&#8217;_blank&#8217;&gt;www.owmnahar.in&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;span&gt;With Best Regards,&lt;/span&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;span&gt;For NAHAR INDUSTRIAL ENTERPRISES LIMITED&lt;/span&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;span&gt;(MUKESH SOOD)&lt;/span&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;p style=&#8217;margin-bottom: 0in; margin-bottom: .0001pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&#8217;&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;span&gt;COMPANY SECRETARY&lt;/span&gt;&lt;/p&gt;&#8221;);<br />
_strMailMessage.Append(&#8220;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#8221;);<br />
_objMailMessage = new MailMessage();<br />
_strMailSubject = &#8220;NAHAR INDUSTRIAL ANNUAL REPORT 2011&#8243;;<br />
_strVenderEmailAddressAfterSplit = strMails.Split(&#8216;;&#8217;);<br />
for (_intFlag = 0; _intFlag &lt; _strVenderEmailAddressAfterSplit.Length &#8211; 1; _intFlag++)<br />
{<br />
String tomail = _strVenderEmailAddressAfterSplit[_intFlag];<br />
_objMailMessage = new MailMessage(Convert.ToString(ConfigurationManager.AppSettings["user"]), tomail, _strMailSubject, _strMailMessage.ToString());<br />
Attachment at = new Attachment(HttpContext.Current.Server.MapPath(&#8220;NIEL10-1116-08-11.pdf&#8221;));<br />
_objMailMessage.Attachments.Add(at);<br />
_objMailMessage.Priority = MailPriority.High;<br />
_objMailMessage.IsBodyHtml = true;<br />
_objSmtpClient = new SmtpClient();<br />
//_objSmtpClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;<br />
_objSmtpClient.Send(_objMailMessage);<br />
WriteError(_objMailMessage.To.ToString() + DateTime.Now);<br />
}</p>
<p>}<br />
}</p>
<p>}<br />
catch (Exception ee)<br />
{<br />
WriteError(ee.Message + DateTime.Now);<br />
}<br />
}</p>
<p>protected void Timer1_Tick(object sender, EventArgs e)<br />
{<br />
Mailer();<br />
}<br />
}</p>
<p>Step 2: Now Place Script Manager and Timer on Your Page</p>
<p>&lt;%@ Page Language=&#8221;C#&#8221; AutoEventWireup=&#8221;true&#8221; CodeFile=&#8221;Default.aspx.cs&#8221; Inherits=&#8221;_Default&#8221; %&gt;</p>
<p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head runat=&#8221;server&#8221;&gt;<br />
&lt;title&gt;&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;form id=&#8221;form1&#8243; runat=&#8221;server&#8221;&gt;<br />
&lt;asp:ScriptManager ID=&#8221;ScriptManager1&#8243; runat=&#8221;server&#8221;&gt;<br />
&lt;/asp:ScriptManager&gt;<br />
&lt;asp:Timer ID=&#8221;Timer1&#8243; runat=&#8221;server&#8221; Interval=&#8221;10000&#8243; ontick=&#8221;Timer1_Tick&#8221;&gt;<br />
&lt;/asp:Timer&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
Step 3: Remember About Wec Config Settings</p>
<p>&lt;?xml version=&#8221;1.0&#8243;?&gt;<br />
&lt;!&#8211;<br />
For more information on how to configure your ASP.NET application, please visit</p>
<p>http://go.microsoft.com/fwlink/?LinkId=169433</p>
<p>&#8211;&gt;<br />
&lt;configuration&gt;<br />
&lt;system.web&gt;<br />
&lt;compilation debug=&#8221;true&#8221; targetFramework=&#8221;4.0&#8243;/&gt;<br />
&lt;/system.web&gt;<br />
&lt;appSettings&gt;<br />
&lt;add key=&#8221;smtpClient&#8221; value=&#8221;127.0.0.1&#8243;/&gt;<br />
&lt;add key=&#8221;pass&#8221; value=&#8221;321&#8243;/&gt;<br />
&lt;add key=&#8221;user&#8221; value=&#8221;abc@gmail.com&#8221;/&gt;<br />
&lt;add key=&#8221;port&#8221; value=&#8221;25&#8243;/&gt;<br />
&lt;/appSettings&gt;<br />
&lt;connectionStrings&gt;<br />
&lt;add name=&#8221;cn&#8221; connectionString=&#8221;Data Source=databasename;Initial Catalog=dbMailingApplication;Persist Security Info=True;User ID=sa;Password=abc&#8221;<br />
providerName=&#8221;System.Data.SqlClient&#8221; /&gt;</p>
<p>&lt;/connectionStrings&gt;<br />
&lt;system.net&gt;<br />
&lt;mailSettings&gt;<br />
&lt;smtp from=&#8221;gmail.com&#8221;&gt;<br />
&lt;network host=&#8221;host&#8221; port=&#8221;25&#8243; userName=&#8221;abc&#8221; password=&#8221;321&#8243;/&gt;<br />
&lt;/smtp&gt;<br />
&lt;/mailSettings&gt;<br />
&lt;/system.net&gt;<br />
&lt;/configuration&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/448/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=448&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2011/08/30/how-to-send-pdf-attachment-in-web-page-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>
	</item>
		<item>
		<title>How Can We Get View State Size oN A Page With Javascript</title>
		<link>http://orientprogrammer.wordpress.com/2011/07/05/how-can-we-get-view-state-size-on-a-page-with-javascript/</link>
		<comments>http://orientprogrammer.wordpress.com/2011/07/05/how-can-we-get-view-state-size-on-a-page-with-javascript/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 11:29:45 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=444</guid>
		<description><![CDATA[Simply Write The Given Script Code &#160; var buf = document.forms[0]["__VIEWSTATE"].value; alert(&#8220;View state is &#8221; + buf.length + &#8221; bytes&#8221;);<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=444&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Simply Write The Given Script Code</p>
<p>&nbsp;</p>
<p>var buf = document.forms[0]["__VIEWSTATE"].value;<br />
alert(&#8220;View state is &#8221; + buf.length + &#8221; bytes&#8221;);</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/444/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=444&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2011/07/05/how-can-we-get-view-state-size-on-a-page-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>
	</item>
		<item>
		<title>Use Of PagedDataSource Class</title>
		<link>http://orientprogrammer.wordpress.com/2011/05/26/use-of-pageddatasource-class/</link>
		<comments>http://orientprogrammer.wordpress.com/2011/05/26/use-of-pageddatasource-class/#comments</comments>
		<pubDate>Thu, 26 May 2011 17:35:04 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=436</guid>
		<description><![CDATA[Hello Friends Today I wil share with you new Experience which i did in my company that&#8217;s Use of Paged Data Source Class. It&#8217;s Really a cool class and give us smart of to paging. With Just A Smart Coding. for This You will have to no need to take tension of Cursors ,Difficult logic&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=436&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello Friends Today I wil share with you new Experience which i did in my company that&#8217;s Use of Paged Data Source Class.<br />
It&#8217;s Really a cool class and give us smart of to paging.<br />
With Just A Smart Coding.</p>
<p>for This You will have to no need to take tension of Cursors ,Difficult logic&#8217;s<br />
Simply Make a new Web Site<br />
and<br />
Do Following Steps of Coding as Given below.<br />
Step 1:Make Presentation view of your page as below given<br />
make a new web forma and place on page<br />
1)DropDownlist(with soem entries)<br />
2) DataList 1(with a link button in itemtemplate)<br />
3) DataList 2(with some bind records using eval)<br />
4) Two Link Button (previous and next)</p>
<p>&lt;p&gt;</p>
<p>&lt;%@ Page Language=&#8221;C#&#8221; AutoEventWireup=&#8221;true&#8221; CodeFile=&#8221;Default.aspx.cs&#8221; Inherits=&#8221;_Default&#8221; %&gt;<br />
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head runat=&#8221;server&#8221;&gt;<br />
&lt;title&gt;&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;form id=&#8221;form1&#8243; runat=&#8221;server&#8221;&gt;<br />
&lt;div&gt;<br />
&lt;table&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
&lt;asp:DropDownList ID=&#8221;ddlselect&#8221; runat=&#8221;server&#8221; AutoPostBack=&#8221;True&#8221;<br />
onselectedindexchanged=&#8221;ddlselect_SelectedIndexChanged&#8221;&gt;<br />
&lt;asp:ListItem&gt;2&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem&gt;4&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem&gt;6&lt;/asp:ListItem&gt;<br />
&lt;/asp:DropDownList&gt;<br />
&lt;asp:LinkButton ID=&#8221;LinkButton1&#8243; Text=&#8221;Previous&#8221; runat=&#8221;server&#8221;<br />
onclick=&#8221;LinkButton1_Click&#8221;&gt;&lt;/asp:LinkButton&gt;<br />
&lt;asp:DataList ID=&#8221;DataList2&#8243; runat=&#8221;server&#8221; RepeatDirection=&#8221;Horizontal&#8221;<br />
onitemcommand=&#8221;DataList2_ItemCommand&#8221;<br />
onitemdatabound=&#8221;DataList2_ItemDataBound&#8221;<br />
onselectedindexchanged=&#8221;DataList2_SelectedIndexChanged&#8221;&gt;<br />
&lt;ItemTemplate&gt;<br />
&lt;asp:LinkButton ID=&#8221;lnkbtnPaging&#8221; runat=&#8221;server&#8221; CommandArgument=&#8217;&lt;%# Eval(&#8220;PageIndex&#8221;) %&gt;&#8217;<br />
CommandName=&#8221;lnkbtnPaging&#8221; Text=&#8217;&lt;%# Eval(&#8220;PageText&#8221;) %&gt;&#8217;&gt;&lt;/asp:LinkButton&gt;<br />
&lt;/ItemTemplate&gt;<br />
&lt;/asp:DataList&gt;&lt;br /&gt;<br />
&lt;asp:LinkButton ID=&#8221;lnkNext&#8221;  Text=&#8221;Next&#8221; runat=&#8221;server&#8221;<br />
onclick=&#8221;lnkNext_Click&#8221;&gt;&lt;/asp:LinkButton&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;asp:DataList ID=&#8221;DataList1&#8243; runat=&#8221;server&#8221;&gt;<br />
&lt;ItemTemplate&gt;<br />
&lt;asp:Label ID=&#8221;Label1&#8243; runat=&#8221;server&#8221; Text=&#8217;&lt;%# Eval(&#8220;BookId&#8221;) %&gt;&#8217;&gt;&lt;/asp:Label&gt;<br />
&lt;asp:Label ID=&#8221;Label2&#8243; runat=&#8221;server&#8221; Text=&#8217;&lt;%# Eval(&#8220;BookName&#8221;) %&gt;&#8217;&gt;&lt;/asp:Label&gt;<br />
&lt;/ItemTemplate&gt;<br />
&lt;/asp:DataList&gt;<br />
&lt;/div&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&lt;/p&gt;</p>
<p><strong>Step 2: Now Do coding As Given Below.</strong><br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;</p>
<p>using System.Data.SqlClient;<br />
using System.Data;<br />
using System.Configuration;<br />
public partial class _Default : System.Web.UI.Page<br />
{</p>
<p>PagedDataSource pds = new PagedDataSource();<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!IsPostBack)<br />
{<br />
BindGrid();<br />
}<br />
}<br />
private void BindGrid()<br />
{<br />
string sql = &#8220;Select * from TbBook Order By BookId&#8221;;<br />
SqlDataAdapter da = new SqlDataAdapter(sql, ConfigurationManager.ConnectionStrings["Or"].ConnectionString);<br />
DataTable dt = new DataTable();<br />
da.Fill(dt);<br />
pds.DataSource = dt.DefaultView;<br />
pds.AllowPaging = true;<br />
pds.PageSize = Convert.ToInt16(ddlselect.SelectedValue);<br />
pds.CurrentPageIndex = CurrentPage;<br />
lnkNext.Enabled = !pds.IsLastPage;<br />
LinkButton1.Enabled = !pds.IsFirstPage;<br />
DataList1.DataSource = pds;<br />
DataList1.DataBind();<br />
doPaging();<br />
}<br />
public int CurrentPage<br />
{</p>
<p>get<br />
{<br />
if (this.ViewState["CurrentPage"] == null)<br />
return 0;<br />
else<br />
return Convert.ToInt32(this.ViewState["CurrentPage"].ToString());<br />
}<br />
set<br />
{<br />
this.ViewState["CurrentPage"] = value;<br />
}</p>
<p>}</p>
<p>private void doPaging()<br />
{<br />
DataTable dt = new DataTable();<br />
dt.Columns.Add(&#8220;PageIndex&#8221;);<br />
dt.Columns.Add(&#8220;PageText&#8221;);<br />
for (int i = 0; i &lt; pds.PageCount; i++)<br />
{<br />
DataRow dr = dt.NewRow();<br />
dr[0] = i;<br />
dr[1] = i + 1;<br />
dt.Rows.Add(dr);<br />
}<br />
DataList2.DataSource = dt;<br />
DataList2.DataBind();<br />
}</p>
<p>protected void DataList2_ItemCommand(object source, DataListCommandEventArgs e)<br />
{<br />
if (e.CommandName.Equals(&#8220;lnkbtnPaging&#8221;))<br />
{<br />
CurrentPage = Convert.ToInt16(e.CommandArgument.ToString());<br />
BindGrid();<br />
}<br />
}<br />
protected void LinkButton1_Click(object sender, EventArgs e)<br />
{<br />
CurrentPage -= 1;<br />
BindGrid();<br />
}<br />
protected void lnkNext_Click(object sender, EventArgs e)<br />
{<br />
CurrentPage += 1;<br />
BindGrid();<br />
}<br />
protected void DataList2_SelectedIndexChanged(object sender, EventArgs e)<br />
{</p>
<p>}<br />
protected void ddlselect_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
CurrentPage = 0;<br />
BindGrid();<br />
}<br />
protected void DataList2_ItemDataBound(object sender, DataListItemEventArgs e)<br />
{<br />
LinkButton lnkbtnPage = (LinkButton)e.Item.FindControl(&#8220;lnkbtnPaging&#8221;);<br />
if (lnkbtnPage.CommandArgument.ToString() == CurrentPage.ToString())<br />
{<br />
lnkbtnPage.Enabled = false;<br />
lnkbtnPage.Font.Bold = true;<br />
}<br />
}<br />
}</p>
<p>Note :Never Forget to make table of tbbook with columns and fill dummy entries int that.<br />
Then Press F5 and Run your web site see the handsome paging of your site.<br />
enjoy and do programming.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/436/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=436&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2011/05/26/use-of-pageddatasource-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>
	</item>
		<item>
		<title>Handsome Use Of Table Type Instead Of Temprary Table In MssqlServer2005</title>
		<link>http://orientprogrammer.wordpress.com/2011/03/26/handsome-use-of-table-type-instead-of-temprary-table-in-mssqlserver2005/</link>
		<comments>http://orientprogrammer.wordpress.com/2011/03/26/handsome-use-of-table-type-instead-of-temprary-table-in-mssqlserver2005/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 10:48:24 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=432</guid>
		<description><![CDATA[Hello Friends Sometime you find an alternative of temprary table which also occupy spaces in our temp database.and you feel other alternative of its in some logics. Today i will you describe you me in exposer which i used in my project for saving of data in mssqlserver into a normalize table. Step 1: Run [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=432&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello Friends Sometime you find an alternative of temprary table which also occupy spaces in our temp database.and you feel other alternative of its in some logics.<br />
Today i will you describe you me in exposer which i used in my project for saving of data in mssqlserver into a normalize table.<br />
Step 1: Run give below script.<br />
USE [master]<br />
GO<br />
/****** Object:  Database [dbPatients]    Script Date: 03/26/2011 16:15:43 ******/<br />
CREATE DATABASE [dbPatients] ON  PRIMARY<br />
( NAME = N&#8217;dbPatients&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\dbPatients.mdf&#8217; , SIZE = 2240KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )<br />
 LOG ON<br />
( NAME = N&#8217;dbPatients_log&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\dbPatients_log.LDF&#8217; , SIZE = 768KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)<br />
 COLLATE SQL_Latin1_General_CP1_CI_AS<br />
GO<br />
EXEC dbo.sp_dbcmptlevel @dbname=N&#8217;dbPatients&#8217;, @new_cmptlevel=90<br />
GO<br />
IF (1 = FULLTEXTSERVICEPROPERTY(&#8216;IsFullTextInstalled&#8217;))<br />
begin<br />
EXEC [dbPatients].[dbo].[sp_fulltext_database] @action = &#8216;enable&#8217;<br />
end<br />
GO<br />
ALTER DATABASE [dbPatients] SET ANSI_NULL_DEFAULT OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET ANSI_NULLS OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET ANSI_PADDING OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET ANSI_WARNINGS OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET ARITHABORT OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET AUTO_CLOSE OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET AUTO_CREATE_STATISTICS ON<br />
GO<br />
ALTER DATABASE [dbPatients] SET AUTO_SHRINK OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET AUTO_UPDATE_STATISTICS ON<br />
GO<br />
ALTER DATABASE [dbPatients] SET CURSOR_CLOSE_ON_COMMIT OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET CURSOR_DEFAULT  GLOBAL<br />
GO<br />
ALTER DATABASE [dbPatients] SET CONCAT_NULL_YIELDS_NULL OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET NUMERIC_ROUNDABORT OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET QUOTED_IDENTIFIER OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET RECURSIVE_TRIGGERS OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET  ENABLE_BROKER<br />
GO<br />
ALTER DATABASE [dbPatients] SET AUTO_UPDATE_STATISTICS_ASYNC OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET DATE_CORRELATION_OPTIMIZATION OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET TRUSTWORTHY OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET ALLOW_SNAPSHOT_ISOLATION OFF<br />
GO<br />
ALTER DATABASE [dbPatients] SET PARAMETERIZATION SIMPLE<br />
GO<br />
ALTER DATABASE [dbPatients] SET  READ_WRITE<br />
GO<br />
ALTER DATABASE [dbPatients] SET RECOVERY FULL<br />
GO<br />
ALTER DATABASE [dbPatients] SET  MULTI_USER<br />
GO<br />
ALTER DATABASE [dbPatients] SET PAGE_VERIFY CHECKSUM<br />
GO<br />
ALTER DATABASE [dbPatients] SET DB_CHAINING OFF<br />
<strong>Step 2: now Make Tables with given below script</strong>.<br />
USE [dbPatients]<br />
GO<br />
/****** Object:  Table [dbo].[tbl_PatientDetail]    Script Date: 03/26/2011 16:16:28 ******/<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
SET ANSI_PADDING ON<br />
GO<br />
CREATE TABLE [dbo].[tbl_PatientDetail](<br />
	[intID] [int] IDENTITY(1,1) NOT NULL,<br />
	[strPatientID] [int] NULL,<br />
	[intHeight] [int] NULL,<br />
	[chrBlodGroup] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,<br />
	[intWeight] [int] NULL,<br />
 CONSTRAINT [PK_tbl_PatientDetail] PRIMARY KEY CLUSTERED<br />
(<br />
	[intID] ASC<br />
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]<br />
) ON [PRIMARY]</p>
<p>GO<br />
SET ANSI_PADDING OFF<br />
<strong>STep 3: Make Second Table</strong><br />
USE [dbPatients]<br />
GO<br />
/****** Object:  Table [dbo].[tbl_PatientMasters]    Script Date: 03/26/2011 16:16:51 ******/<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
SET ANSI_PADDING ON<br />
GO<br />
CREATE TABLE [dbo].[tbl_PatientMasters](<br />
	[intID] [int] NOT NULL,<br />
	[strFullName] [varchar](40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,<br />
	[strAddress] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,<br />
	[strPhoneNo] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,<br />
	[chrGender] [char](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,<br />
 CONSTRAINT [PK_tbl_PatientMasters] PRIMARY KEY CLUSTERED<br />
(<br />
	[intID] ASC<br />
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]<br />
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]</p>
<p>GO<br />
SET ANSI_PADDING OFF<br />
STep 4: now Run Given Below Script and view Table Type use<br />
DECLARE	@strFullName VARCHAR(40)<br />
DECLARE	@strAddress VARCHAR(200)<br />
DECLARE @strPhoneNo VARCHAR(10)<br />
DECLARE @chrGender CHAR(1)<br />
DECLARE @intHeight INT<br />
DECLARE @chrBloodGroup Char(2)<br />
DECLARE @intWeight INT</p>
<p>SET	@strFullName=&#8217;Lakshya&#8217;<br />
SET	@strAddress=&#8217;H.No 745,St.no 12,Patiala&#8217;<br />
SET @strPhoneNo =&#8217;9989987156&#8242;<br />
SET @chrGender =&#8217;M&#8217;<br />
SET @intHeight =145<br />
SET @chrBloodGroup =&#8217;B+&#8217;<br />
SET @intWeight =123</p>
<p>DECLARE @TBLPATIENTINFO TABLE (INTID INT IDENTITY(1,1) PRIMARY KEY,STRNAME VARCHAR(40),STRADD TEXT,STRPHONE VARCHAR(10),CHRGENDER CHAR(1),INTHEIGHT INT,CHRBLOODGROUP CHAR(2),INTWEIGHT INT)<br />
INSERT INTO @TBLPATIENTINFO VALUES(@strFullName,@strAddress,@strPhoneNo,@chrGender,@intHeight,@chrBloodGroup,@intWeight)<br />
	IF ((SELECT COUNT(*) FROM @TBLPATIENTINFO)&gt;0)<br />
		BEGIN<br />
				INSERT tbl_PatientMasters(intID,strFullName,strAddress,strPhoneNo,chrGender)<br />
				SELECT<br />
					(<br />
					SELECT MAX(dbo.tbl_PatientMasters.intID) FROM dbo.tbl_PatientMasters<br />
					)+ INTID,STRNAME,STRADD,STRPHONE,CHRGENDER FROM @TBLPATIENTINFO<br />
				INSERT tbl_PatientDetail(strPatientID,intHeight,chrBlodGroup,intWeight)<br />
				SELECT (<br />
					SELECT MAX(dbo.tbl_PatientMasters.intID) FROM dbo.tbl_PatientMasters<br />
					),INTHEIGHT,CHRBLOODGROUP,INTWEIGHT  FROM @TBLPATIENTINFO<br />
			PRINT &#8216;RECORD IS INSERT,DO it AGAIN GUY!!&#8217;<br />
		END<br />
	ELSE<br />
		BEGIN<br />
		PRINT &#8216;NO RECORD IS INSERT,TRY AGAIN GUY!!&#8217;<br />
<strong>enjoy and learn happy programming!</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/432/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=432&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2011/03/26/handsome-use-of-table-type-instead-of-temprary-table-in-mssqlserver2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>
	</item>
		<item>
		<title>NTILE FUNCTIon of MSSQLSERVER</title>
		<link>http://orientprogrammer.wordpress.com/2011/03/21/421/</link>
		<comments>http://orientprogrammer.wordpress.com/2011/03/21/421/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 07:21:48 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=421</guid>
		<description><![CDATA[NTILE(): This is one of the most coolest function provided by T-SQL. This is very useful while grouping a dataset into multiple sets i.e. in case if you want to distribute the result set into more than one tables or destination, this function is useful in accomplishing this task. Let’s consider we have a table [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=421&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>NTILE(): This is one of the most coolest function provided by T-SQL. This is very useful while grouping a dataset into multiple sets i.e. in case if you want to distribute the result set into more than one tables or destination, this function is useful in accomplishing this task.</p>
<p>Let’s consider we have a table with 1 million records, and we want to divide this 1 million records across five tables, then we can achieve this by using NTILE () function.</p>
<p>The functionality of NTILE () function is same as other ranking functions i.e. ROW_NUMBER(), RANK() and DENSE_RANK(), except it takes one parameter named “integer_expression” i.e. NTILE(integer_expression). The integer_expression signifies the number of groups the NTILE function will create to distribute the data. integer_expression can be of type int, or bigint but must be positive integer. If you specify any other value like 2.5 or -3, it will throw the below error:</p>
<p>The function ‘ntile’ takes only a positive int or bigint expression as its input.</p>
<p>Let’s consider the example of Employee table, where we have 7 records, and our purpose is to distribute these records into two separate tables, one containing highest salaries and the other with lower salaries. Then the query goes like this:</p>
<p>For the table with Highest Salaries:</p>
<p>[ Copy to Clipboard ] | [ View Source ]<br />
SELECT * FROM (<br />
SELECT NTILE(2) OVER( ORDER BY salary DESC) AS GroupID,* FROM dbo.employee<br />
) InnQ<br />
WHERE InnQ.GroupID = 1<br />
OUTPUT:</p>
<p><a href="http://orientprogrammer.files.wordpress.com/2011/03/ntile1.gif"><img src="http://orientprogrammer.files.wordpress.com/2011/03/ntile1.gif?w=150&#038;h=76" alt="" title="Ntile1" width="150" height="76" class="aligncenter size-thumbnail wp-image-422" /></a><br />
For the table with Lowest Salaries:</p>
<p>SELECT * FROM (<br />
SELECT NTILE(2) OVER( ORDER BY salary DESC) AS GroupID,* FROM dbo.employee<br />
) InnQ<br />
WHERE InnQ.GroupID = 2</p>
<p><a href="http://orientprogrammer.files.wordpress.com/2011/03/ntile2.gif"><img src="http://orientprogrammer.files.wordpress.com/2011/03/ntile2.gif?w=150&#038;h=67" alt="" title="Ntile2" width="150" height="67" class="aligncenter size-thumbnail wp-image-423" /></a><br />
You might have noticed here that in the first set we have four records while in the second one we have three records. This is because; we have odd number of records in the employee table from where these sets are derived. When the integer_expression parameter is divisible with the total number of records in the source table, then we can get even number of records in all the sets derived from it or else it will start filling the remaining records starting from first set.</p>
<p>Let’s dissect the query a little:</p>
<p>SELECT NTILE(2) OVER( ORDER BY salary DESC) AS GroupID,* FROM dbo.employee;<br />
<a href="http://orientprogrammer.files.wordpress.com/2011/03/ntile3.gif"><img src="http://orientprogrammer.files.wordpress.com/2011/03/ntile3.gif?w=150&#038;h=104" alt="" title="Ntile3" width="150" height="104" class="aligncenter size-thumbnail wp-image-424" /></a></p>
<p>GroupID column has two distinct numbers on the basis of which the records are divided into two separate sets as shown below.</p>
<p><a href="http://orientprogrammer.files.wordpress.com/2011/03/ntile4.gif"><img src="http://orientprogrammer.files.wordpress.com/2011/03/ntile4.gif?w=150&#038;h=84" alt="" title="Ntile4" width="150" height="84" class="aligncenter size-thumbnail wp-image-425" /></a><br />
As the total number of records in the employee table is not divisible by the integer_expression parameter in NTILE (), we have two groups with different sizes differ by one member. The group with higher number of members comes before the group with small number of members.</p>
<p>Using  in NTILE():</p>
<p> clause in NTILE () function increases it functionality a little more. Here, we will see how partition by affects NTILE () in the above example. Let’s consider the below query to group records by department wise.</p>
<p>SELECT NTILE(2) OVER(PARTITION BY DeptNo ORDER BY salary DESC) AS GroupID,* FROM dbo.employee;<br />
OUTPUT:<br />
<a href="http://orientprogrammer.files.wordpress.com/2011/03/ntile5.gif"><img src="http://orientprogrammer.files.wordpress.com/2011/03/ntile5.gif?w=150&#038;h=106" alt="" title="Ntile5" width="150" height="106" class="aligncenter size-thumbnail wp-image-426" /></a></p>
<p>Let’s dissect the above query and see the process behind it.</p>
<p>The OVER clause in the query will partition the employee table as per DeptNo i.e. into three sub-sets. Then the NTILE(2) will divide each partition into groups of two as show in the below figure.<br />
<a href="http://orientprogrammer.files.wordpress.com/2011/03/ntile6.gif"><img src="http://orientprogrammer.files.wordpress.com/2011/03/ntile6.gif?w=150&#038;h=95" alt="" title="Ntile6" width="150" height="95" class="aligncenter size-thumbnail wp-image-427" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/421/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=421&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2011/03/21/421/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>

		<media:content url="http://orientprogrammer.files.wordpress.com/2011/03/ntile1.gif?w=150" medium="image">
			<media:title type="html">Ntile1</media:title>
		</media:content>

		<media:content url="http://orientprogrammer.files.wordpress.com/2011/03/ntile2.gif?w=150" medium="image">
			<media:title type="html">Ntile2</media:title>
		</media:content>

		<media:content url="http://orientprogrammer.files.wordpress.com/2011/03/ntile3.gif?w=150" medium="image">
			<media:title type="html">Ntile3</media:title>
		</media:content>

		<media:content url="http://orientprogrammer.files.wordpress.com/2011/03/ntile4.gif?w=150" medium="image">
			<media:title type="html">Ntile4</media:title>
		</media:content>

		<media:content url="http://orientprogrammer.files.wordpress.com/2011/03/ntile5.gif?w=150" medium="image">
			<media:title type="html">Ntile5</media:title>
		</media:content>

		<media:content url="http://orientprogrammer.files.wordpress.com/2011/03/ntile6.gif?w=150" medium="image">
			<media:title type="html">Ntile6</media:title>
		</media:content>
	</item>
		<item>
		<title>File Upload Control With Regular Expression Validation Control In asp.net 4.0 With Ajax</title>
		<link>http://orientprogrammer.wordpress.com/2010/12/13/file-upload-control-with-regular-expression-validation-control-in-asp-net-4-0-with-ajax/</link>
		<comments>http://orientprogrammer.wordpress.com/2010/12/13/file-upload-control-with-regular-expression-validation-control-in-asp-net-4-0-with-ajax/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 12:21:43 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=415</guid>
		<description><![CDATA[Aryan Vermahttp://orientprogrammer.wordpress.com Step 1: Make A New Web Site Using IDE 4.0 (Visual Studio 2010) and after clicking on new web site you will get interface look as below given. Step 2: Now place given control in code or can write to these. .style1 { color: #FF9900; } File Upload Control With Regular Expression Validator [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=415&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- Facebook Badge START --><a href="http://www.facebook.com/OrientAryan" target="_TOP" style="font-family:&quot;font-size:11px;font-variant:normal;font-style:normal;font-weight:normal;color:#3B5998;text-decoration:none;" title="Aryan Verma">Aryan Verma</a><br /><a href="http://www.facebook.com/OrientAryan" target="_TOP" title="Aryan Verma"><img src="http://badge.facebook.com/badge/100001373735451.812.1273621785.png" width="120" height="281" style="border:0;" /></a><br /><a href="http://www.facebook.com/badges/" target="_TOP" style="font-family:&quot;font-size:11px;font-variant:normal;font-style:normal;font-weight:normal;color:#3B5998;text-decoration:none;" title="Make your own badge!">http://orientprogrammer.wordpress.com</a><!-- Facebook Badge END --><br />
Step 1: Make  A New Web Site Using IDE 4.0 (Visual Studio 2010)<br />
and after clicking on new web site you will get interface look as below given.<br />
<a href="http://orientprogrammer.files.wordpress.com/2010/12/1.jpg"><br />
<img src="http://orientprogrammer.files.wordpress.com/2010/12/1.jpg?w=150&#038;h=112" alt="" title="1" width="150" height="112" class="aligncenter size-thumbnail wp-image-416" /></a><br />
Step 2: Now place given control in code or can write to these.</p>
<p>    <title></title></p>
<p>        .style1<br />
        {<br />
            color: #FF9900;<br />
        }</p>
<form>
<div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="3" style="font-family:Helvetica;font-size:12pt;width:100%;background-color:#0a5999;color:White;">
                            File Upload Control With Regular Expression Validator And Validations On Image Uploading
                        </td>
</tr>
<tr>
<td style="width:25%;">
                            <span class="style1"><strong>Upload Gravatar</strong></span>
                        </td>
<td style="width:50%;">
</td>
<td style="width:25%;">
</td>
</tr>
</table></div>
</p></form>
<p>Now Run and Enjoy In This .net World</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/415/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/415/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/415/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/415/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/415/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/415/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/415/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/415/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/415/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/415/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/415/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/415/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/415/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/415/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=415&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2010/12/13/file-upload-control-with-regular-expression-validation-control-in-asp-net-4-0-with-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>

		<media:content url="http://badge.facebook.com/badge/100001373735451.812.1273621785.png" medium="image" />

		<media:content url="http://orientprogrammer.files.wordpress.com/2010/12/1.jpg?w=150" medium="image">
			<media:title type="html">1</media:title>
		</media:content>
	</item>
		<item>
		<title>How to get table,database size in Sql Server</title>
		<link>http://orientprogrammer.wordpress.com/2010/12/13/how-to-get-tabledatabase-size-in-sql-server/</link>
		<comments>http://orientprogrammer.wordpress.com/2010/12/13/how-to-get-tabledatabase-size-in-sql-server/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 06:57:23 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=409</guid>
		<description><![CDATA[In this article,i would share with you, how to get size of the tables in database in sql server.When you are move your database to production, then you have to check the database size once week or month. becuase host provider give the limited database capacity. EXEC sp_spaceused In above Text,when we are excute the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=409&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this article,i would share with you, how to get size of the tables in database in sql server.When you are move your database to production, then you have to check the database size once week or month. becuase host provider give the limited database capacity.</p>
<p><strong>EXEC sp_spaceused</strong></p>
<p>In above Text,when we are excute the sp_spaceused without any parameters, it will take defult parameter as null and refurn the current database size and details about that database</p>
<p>How to get all table size and other details</p>
<p>In this time we have to use our custom procedure to do this, becuase there is no inbuilt proc to get this details in sql server.how we can do this, let create a procedure and get all tables name from the database and fetch into cursor.</p>
<p>CREATE PROCEDURE spCodeGainSizeUtil<br />
AS<br />
DECLARE @TableName VARCHAR(100)<br />
DECLARE dataCursor CURSOR<br />
		FOR<br />
		select [name]<br />
		from dbo.sysobjects<br />
		where  OBJECTPROPERTY(id, N&#8217;IsUserTable&#8217;) = 1<br />
		FOR READ ONLY</p>
<p>CREATE TABLE #SizeTable<br />
(<br />
    tableName varchar(100),<br />
    numberofRows varchar(100),<br />
    reservedSize varchar(50),<br />
    dataSize varchar(50),<br />
    indexSize varchar(50),<br />
    unusedSize varchar(50)<br />
)</p>
<p>&#8211;Open the cursor<br />
OPEN dataCursor</p>
<p>&#8211;Get the first table name from the cursor<br />
FETCH NEXT FROM dataCursor INTO @TableName</p>
<p>&#8211;Loop until the cursor was not able to fetch<br />
WHILE (@@Fetch_Status &gt;= 0)<br />
	BEGIN</p>
<p>		INSERT  #SizeTable<br />
			EXEC sp_spaceused @TableName<br />
		FETCH NEXT FROM dataCursor INTO @TableName<br />
	END<br />
CLOSE dataCursor<br />
DEALLOCATE dataCursor<br />
SELECT * FROM #SizeTable<br />
DROP TABLE #SizeTable</p>
<p>GO<br />
Enjoy in .net World!!!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/409/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=409&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2010/12/13/how-to-get-tabledatabase-size-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert DataSet To String In C#.Net</title>
		<link>http://orientprogrammer.wordpress.com/2010/12/07/convert-dataset-to-string-in-c-net/</link>
		<comments>http://orientprogrammer.wordpress.com/2010/12/07/convert-dataset-to-string-in-c-net/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 11:15:16 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=407</guid>
		<description><![CDATA[private string GetTemplate() { string sReturnData = string.Empty; try { string connectionString = &#8220;Provider=Microsoft.Jet.OleDb.4.0; data source=c:\\YRF.XLS; Extended Properties=Excel 8.0;&#8221;; string selectString = &#8220;SELECT * FROM [new$]&#8220;; System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand(); System.Data.OleDb.OleDbDataAdapter adp = new System.Data.OleDb.OleDbDataAdapter(selectString,connectionString); DataSet ds=new DataSet(); adp.Fill(ds); System.Data.OleDb.OleDbConnection con = new System.Data.OleDb.OleDbConnection(connectionString); System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand(selectString, con); con.Open(); System.Data.OleDb.OleDbDataReader theData = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=407&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> private string GetTemplate()<br />
    {<br />
        string sReturnData = string.Empty;<br />
        try<br />
        {</p>
<p>            string connectionString = &#8220;Provider=Microsoft.Jet.OleDb.4.0; data source=c:\\YRF.XLS; Extended Properties=Excel 8.0;&#8221;;<br />
            string selectString = &#8220;SELECT * FROM [new$]&#8220;;</p>
<p>            System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand();<br />
            System.Data.OleDb.OleDbDataAdapter adp = new System.Data.OleDb.OleDbDataAdapter(selectString,connectionString);<br />
            DataSet ds=new DataSet();<br />
            adp.Fill(ds);<br />
            System.Data.OleDb.OleDbConnection con = new System.Data.OleDb.OleDbConnection(connectionString);<br />
            System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand(selectString, con);</p>
<p>            con.Open();<br />
            System.Data.OleDb.OleDbDataReader theData = cmd.ExecuteReader();</p>
<p>            Int32 i = 0;<br />
            String str = &#8220;&#8221;;<br />
            System.Data.DataTable dt = new System.Data.DataTable();<br />
            dt = ds.Tables[0];<br />
            str += &#8220;&#8221;;<br />
            while (i &lt; dt.Rows.Count)<br />
            {<br />
                str += &quot;&#8221; + dt.Rows[i][0].ToString() + &#8220;&#8221; + &#8220;&#8221; + dt.Rows[i][1].ToString() + &#8220;&#8221; + &#8220;&#8221; + dt.Rows[i][2].ToString() + &#8220;&#8221; + &#8220;&#8221; + dt.Rows[i][3].ToString() + &#8220;&#8221; + &#8220;&#8221; + dt.Rows[i][4].ToString() + &#8220;&#8221; + &#8220;&#8221; + dt.Rows[i][5].ToString() + &#8220;&#8221; + &#8220;&#8221; + dt.Rows[i][6].ToString() + &#8220;&#8221; + &#8220;&#8221; + dt.Rows[i][7].ToString() + &#8220;&#8221; + &#8220;&#8221; + dt.Rows[i][8].ToString() + &#8220;&#8221; + &#8220;&#8221; + dt.Rows[i][9].ToString() + &#8220;&#8221;;<br />
                sReturnData += str;<br />
                i++;<br />
            }</p>
<p>        }<br />
        catch (Exception ex)<br />
        {<br />
            lblError.Text = ex.Message;<br />
            sReturnData = &#8220;No Value&#8221;;<br />
        }</p>
<p>        sReturnData += &#8220;&#8221;;<br />
        return sReturnData;<br />
    }</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/407/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=407&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2010/12/07/convert-dataset-to-string-in-c-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Alter MSDB Database SMTP Server Name</title>
		<link>http://orientprogrammer.wordpress.com/2010/10/12/how-to-alter-msdb-database-smtp-server-name/</link>
		<comments>http://orientprogrammer.wordpress.com/2010/10/12/how-to-alter-msdb-database-smtp-server-name/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 05:58:21 +0000</pubDate>
		<dc:creator>orientprogrammer</dc:creator>
		
		<guid isPermaLink="false">http://orientprogrammer.wordpress.com/?p=403</guid>
		<description><![CDATA[This Command Will show You All Items From sysmail_allitems table SELECT * FROM sysmail_allitems This will Show You Mailed Items SELECT * FROM sysmail_mailitems This Command Your Mail Account SELECT * FROM sysmail_account In this TAble You Will get Your mail SERVER Credential or His Name May be IP Address SELECT * FROM sysmail_server From [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=403&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This Command Will show You All Items From sysmail_allitems table<br />
SELECT * FROM sysmail_allitems</p>
<p>This will Show You Mailed Items<br />
SELECT * FROM sysmail_mailitems</p>
<p>This Command Your Mail Account<br />
SELECT * FROM sysmail_account<br />
In this TAble You Will get Your mail SERVER Credential or His Name May be IP Address<br />
SELECT * FROM sysmail_server<br />
From this table you can get Mail Log Information<br />
SELECT *FROM sysmail_log</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orientprogrammer.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orientprogrammer.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orientprogrammer.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orientprogrammer.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/orientprogrammer.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/orientprogrammer.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/orientprogrammer.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/orientprogrammer.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orientprogrammer.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orientprogrammer.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orientprogrammer.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orientprogrammer.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orientprogrammer.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orientprogrammer.wordpress.com/403/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orientprogrammer.wordpress.com&amp;blog=14097541&amp;post=403&amp;subd=orientprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://orientprogrammer.wordpress.com/2010/10/12/how-to-alter-msdb-database-smtp-server-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52ff56150820a4824081e5300e436b3c?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">orientprogrammer</media:title>
		</media:content>
	</item>
	</channel>
</rss>
