<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-1412349307459676978</atom:id><lastBuildDate>Sat, 07 Sep 2024 22:05:11 +0000</lastBuildDate><category>SQL</category><category>Dot Net</category><title>Asp.Net &amp;amp; SQL Help</title><description></description><link>http://dotnetnsql.blogspot.com/</link><managingEditor>noreply@blogger.com (ashapatel)</managingEditor><generator>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-500952157141174503</guid><pubDate>Mon, 06 Jul 2009 05:49:00 +0000</pubDate><atom:updated>2009-07-05T23:22:54.563-07:00</atom:updated><title>Validation of viewstate MAC failed error</title><description>when the following preconditions are true:&lt;br /&gt;&lt;br /&gt;1. You aren&#39;t using a web farm.&lt;br /&gt;2. It appears when using built-in databound controls such as GridView, DetailsView or FormView which utilize “DataKeyNames”.&lt;br /&gt;3. It appears if you have a large page which loads slowly for any reason.&lt;br /&gt;&lt;br /&gt;If following preconditions are true and you click a postbacking control/link and the page hasn&#39;t loaded completely in client browser, you might get the &quot;Validation of ViewState MAC failed&quot; exception.&lt;br /&gt;&lt;br /&gt;When this happens, if you just try setting the page property &quot;EnableViewStateMac&quot; to false, it does not solve the problem, it just changes the error message in same navigation behavior:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;style1&quot;&gt;The state information is invalid for&lt;br /&gt;this page and might be corrupted.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Root Cause&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This exception appears because Controls using DataKeyNames require Viewstate to be encrypted. When Viewstate is encrypted (Default mode, Auto, is to encrypt if controls require that, otherwise not), Page adds &lt;input name=&quot;__VIEWSTATEENCRYPTED&quot; id=&quot;__VIEWSTATEENCRYPTED&quot; value=&quot;&quot; type=&quot;hidden&quot;&gt; field just before closing of the &lt; form &gt; tag. But this hidden field might not have been rendered to the browser with long-running pages, and if you make a postback before it does, the browser initiates postback without this field (in form post collection). End result is that if this field is omitted on postback, the page doesn&#39;t know that Viewstate is encrypted and causes the aforementioned Exception. I.E. page expects to be fully-loaded before you make a postback.&lt;br /&gt;&lt;br /&gt;And by the way similar problem is with event validation since __EVENTVALIDATION field is also rendered on the end of the form. This is a security feature that ensures that postback actions only come from events allowed and created by the server to help prevent spoofed postbacks. This feature is implemented by having controls register valid events when they render (as in, during their actual Render() methods). The end result is that at the bottom of your rendered  tag, you&#39;ll see something like this: &lt;input name=&quot;__EVENTVALIDATION&quot; id=&quot;__EVENTVALIDATION&quot; value=&quot;AEBnx7v.........tS&quot; type=&quot;hidden&quot;&gt;. When a postback occurs, ASP.NET uses the values stored in this hidden field to ensure that the button you clicked invokes a valid event. If it&#39;s not valid, you get the exception above.&lt;br /&gt;&lt;br /&gt;The problem happens specifically when you postback before the EventValidation field has been rendered. If EventValidation is enabled (which it is, by default), but ASP.net doesn&#39;t see the hidden field when you postback, you also get the exception. If you submit a form before it has been entirely rendered, then chances are the EventValidation field has not yet been rendered, and thus ASP.NET cannot validate your click.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Workarounds&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. Set enableEventValidation to false and viewStateEncryptionMode to Never as follows:&lt;br /&gt;&lt;br /&gt;&lt;pages enableeventvalidation=&quot;false&quot; viewstateencryptionmode=&quot;Never&quot;&gt;&lt;br /&gt;&lt;br /&gt;This has the unwanted side-effect of disabling validation and encryption.  On some sites, this may be ok to do, but it isn&#39;t a best practice, especially in publicly facing sites.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Another way around the problem is to mark the form as disabled and then enable it in script once the load is complete:&lt;br /&gt; function enableForm() {&lt;br /&gt;     document.getElementById(&quot;form&quot;).disabled = false;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; window.onLoad = enableForm();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Or you can disable the individual form elements and enable them once everything is loaded:&lt;br /&gt;&lt;br /&gt; function disableElements(elements) {&lt;br /&gt; for (var i = elements.length - 1; i &gt;= 0; i--) {&lt;br /&gt;   var elmt = elements[i];&lt;br /&gt;&lt;br /&gt;   if (!elmt.disabled) {&lt;br /&gt;     elmt.disabled = true;&lt;br /&gt;   }&lt;br /&gt;   else {&lt;br /&gt;     elmt._wasDisabled = true;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function disableFormElements() {&lt;br /&gt; disableElements(_form.getElementsByTagName(&quot;INPUT&quot;));&lt;br /&gt; disableElements(_form.getElementsByTagName(&quot;SELECT&quot;));&lt;br /&gt; disableElements(_form.getElementsByTagName(&quot;TEXTAREA&quot;));&lt;br /&gt; disableElements(_form.getElementsByTagName(&quot;BUTTON&quot;));&lt;br /&gt; disableElements(_form.getElementsByTagName(&quot;A&quot;));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function enableElements(elements) {&lt;br /&gt; for (var i = elements.length - 1; i &gt;= 0; i--) {&lt;br /&gt;   var elmt = elements[i];&lt;br /&gt;   if (!elmt._wasDisabled) {&lt;br /&gt;     elmt.disabled = false;&lt;br /&gt;   }&lt;br /&gt;   else {&lt;br /&gt;     elmt._wasDisabled = null;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function enableFormElements() {&lt;br /&gt; enableElements(_form.getElementsByTagName(&quot;INPUT&quot;));&lt;br /&gt; enableElements(_form.getElementsByTagName(&quot;SELECT&quot;));&lt;br /&gt; enableElements(_form.getElementsByTagName(&quot;TEXTAREA&quot;));&lt;br /&gt; enableElements(_form.getElementsByTagName(&quot;BUTTON&quot;));&lt;br /&gt; enableElements(_form.getElementsByTagName(&quot;A&quot;));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Make sure that the variable _form is set to the ASP.net form on the page. Then just call enableFormElements() and disableFormElements().&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. The last way to workaround this problem is to override the Render Event of the page to place the hidden fields for Encrypted Viewstate and Event validation on the top of the form.  This will ensure that these things get written out before anything that can submit the form:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;protected override void Render(System.Web.UI.HtmlTextWriter writer)&lt;br /&gt;{&lt;br /&gt; System.IO.StringWriter stringWriter =&lt;br /&gt;     new System.IO.StringWriter();&lt;br /&gt; HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);&lt;br /&gt; base.Render(htmlWriter);&lt;br /&gt; string html = stringWriter.ToString();&lt;br /&gt; string[] aspnet_formelems = new string[5];&lt;br /&gt; aspnet_formelems[0] = &quot;__EVENTTARGET&quot;;&lt;br /&gt; aspnet_formelems[1] = &quot;__EVENTARGUMENT&quot;;&lt;br /&gt; aspnet_formelems[2] = &quot;__VIEWSTATE&quot;;&lt;br /&gt; aspnet_formelems[3] = &quot;__EVENTVALIDATION&quot;;&lt;br /&gt; aspnet_formelems[4] = &quot;__VIEWSTATEENCRYPTED&quot;;&lt;br /&gt; foreach (string elem in aspnet_formelems)&lt;br /&gt; {&lt;br /&gt;   //Response.Write(&quot;input type=&quot;&quot;hidden&quot;&quot; name=&quot;&quot;&quot; &amp;amp; abc.ToString &amp;amp; &quot;&quot;&quot;&quot;)&lt;br /&gt;   int StartPoint = html.IndexOf(&quot;&lt;input name=&quot;\&amp;quot;&amp;quot;&quot; if=&quot;&quot; startpoint=&quot;&quot; type=&quot;\&amp;quot;hidden\&amp;quot;&quot;&gt;= 0)&lt;br /&gt;   {&lt;br /&gt;     //does __VIEWSTATE exist?&lt;br /&gt;     int EndPoint = html.IndexOf(&quot;/&gt;&quot;, StartPoint) + 2;&lt;br /&gt;     string ViewStateInput = html.Substring(StartPoint,&lt;br /&gt;       EndPoint - StartPoint);&lt;br /&gt;     html = html.Remove(StartPoint, EndPoint - StartPoint);&lt;br /&gt;     int FormStart = html.IndexOf(&quot;&lt; form &quot;); int=&quot;&quot; endform = &quot;html. IndexOf(&amp;quot;&quot;&gt;&quot;, FormStart ) + 1;&lt;br /&gt;     if (EndForm &gt;= 0)&lt;br /&gt;       html = html.Insert( EndForm , ViewStateInput);&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; writer.Write(html);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt; / form&quot;);&gt;&lt;/pages&gt;&lt; / form&gt;</description><link>http://dotnetnsql.blogspot.com/2009/07/validation-of-viewstate-mac-failed.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-1375641282986092219</guid><pubDate>Fri, 03 Jul 2009 06:16:00 +0000</pubDate><atom:updated>2009-07-02T23:19:36.697-07:00</atom:updated><title>About Visual Studio 2008</title><description>Microsoft Visual Studio is an Integrated Development Environment (IDE) from Microsoft. It can be used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native codetogether with managed code for all platforms supported by Microsoft Windows, Windows Mobile, Windows CE, .NET Framework, .NET Compact Framework and Microsoft Silverlight.&lt;br /&gt;&lt;br /&gt;Visual Studio includes a code editor supporting IntelliSense as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other built-in tools include a forms designer for building GUI applications, web designer, classdesigner, and database schema designer. It allows plug-ins to be added that enhance the functionality at almost every level - including adding support for source control systems (likeSubversion and Visual SourceSafe) to adding new toolsets like editors and visual designers fordomain-specific languages or toolsets for other aspects of the software development lifecycle(like the Team Foundation Server client: Team Explorer).&lt;br /&gt;&lt;br /&gt;Visual Studio supports languages by means of language services, which allow anyprogramming language to be supported (to varying degrees) by the code editor and debugger, provided a language-specific service has been authored. Built-in languages include C/C++ (viaVisual C++), VB.NET (via Visual Basic .NET), and C# (via Visual C#). Support for other languages such as F#, M, Python, and Ruby among others has been made available via language services which are to be installed separately. It also supports XML/XSLT,HTML/XHTML, JavaScript and CSS. Language-specific versions of Visual Studio also exist which provide more limited language services to the user. These individual packages are called Microsoft Visual Basic, Visual J#, Visual C#, and Visual C++.&lt;br /&gt;&lt;br /&gt;Microsoft provides &quot;Express&quot; editions of its Visual Studio 2008 components Visual Basic, Visual C#, Visual C++, and Visual Web Developer at no cost. Visual Studio 2008 and 2005 Professional Editions, along with language-specific versions (Visual Basic, C++, C#, J#) of Visual Studio 2005 are available for free to students as downloads via Microsoft&#39;s DreamSpark program. Visual Studio 2010 is currently in beta testing and can be downloaded by the general public at no cost.</description><link>http://dotnetnsql.blogspot.com/2009/07/about-visual-studio-2008.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-2784179427834880520</guid><pubDate>Tue, 23 Jun 2009 09:44:00 +0000</pubDate><atom:updated>2009-06-23T02:51:26.111-07:00</atom:updated><title>Get All Dates Of Year Which are Sunday</title><description>ArrayList allSundays = getAllWeekDates(DateTime.Now.Year);&lt;br /&gt;       for (int i = 0; i &lt; allSundays.Count; i++)&lt;br /&gt;       {&lt;br /&gt;           Response.Write(allSundays[i]+&quot;  &quot;);&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;public ArrayList getAllWeekDates(int Year)&lt;br /&gt;{&lt;br /&gt;  ArrayList strDates=new ArrayList();&lt;br /&gt;  for (int month = 1; month &lt;= 12; month++)         {             DateTime dt = new DateTime(Year, month, 1);             int firstSundayOfMonth = (int)dt.DayOfWeek;             if (firstSundayOfMonth != 0)             {                 dt = dt.AddDays((6 - firstSundayOfMonth) + 1);             }             while (dt.Month == month)             {                 strDates.Add(dt.ToString(&quot;dd/MMM/yyyy&quot;));                 dt = dt.AddDays(7);             }         }         return strDates;     }&lt;span class=&quot;fullpost&quot;&gt;&lt;/span&gt;</description><link>http://dotnetnsql.blogspot.com/2009/06/get-all-dates-of-year-which-are-sunday.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-7512607605279110289</guid><pubDate>Tue, 23 Jun 2009 08:56:00 +0000</pubDate><atom:updated>2009-06-23T02:00:25.242-07:00</atom:updated><title>Get Day Neame Between Start Date and End Date</title><description>DateTime StartDate = new DateTime();&lt;br /&gt;       DateTime EndDate = new DateTime();&lt;br /&gt;       StartDate = Convert.ToDateTime(&quot;06-23-2009&quot;);&lt;br /&gt;       EndDate = Convert.ToDateTime(&quot;06-9-2009&quot;);&lt;br /&gt;       int day = EndDate.Subtract(StartDate).Days;&lt;br /&gt;&lt;br /&gt;       for (int i = 0; i &lt;= day; i++)&lt;br /&gt;       {&lt;br /&gt;           DateTime newdate = Convert.ToDateTime(StartDate.AddDays(i).ToShortDateString());&lt;br /&gt;           string newday = newdate.DayOfWeek.ToString();&lt;br /&gt;           Response.Write(newdate+&quot;=&quot;+ newday );&lt;br /&gt;      }</description><link>http://dotnetnsql.blogspot.com/2009/06/get-day-neame-between-start-date-and.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-2396214151457420712</guid><pubDate>Fri, 17 Apr 2009 11:13:00 +0000</pubDate><atom:updated>2009-04-17T04:29:31.097-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>Grouping Sets  - In SQL Server 2008</title><description>The grouping sets feature allows the developer to group data selected &lt;br /&gt;&lt;br /&gt;in the same select statement into different groups.&lt;br /&gt;&lt;br /&gt;The grouping sets intended to provide a powerful grouping tool in a &lt;br /&gt;&lt;br /&gt;single SQL Statement by different fields having the same selection &lt;br /&gt;&lt;br /&gt;number of fields. This feature is especially useful in the case of &lt;br /&gt;&lt;br /&gt;collecting summary data using different criteria.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Steps :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Follow the easy steps below to create your environment and work area.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;1.&lt;/span&gt;    Open Microsoft SQL Server Management Studio.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;2.&lt;/span&gt;    Right click the database DbWork and choose query window.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;3.&lt;/span&gt;    Use the listing below to create a customer address table that &lt;br /&gt;&lt;br /&gt;would contain all the orders by a specific customer id.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Listing 1&lt;/span&gt; - T-SQL to create the order table&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[TblCustomerAddress](&lt;br /&gt;      [CustomerId] [int] NOT NULL,&lt;br /&gt;      [CustomerContinent] [varchar](50) NOT NULL,&lt;br /&gt;      [CustomerCountry] [varchar](50) NOT NULL,&lt;br /&gt;      [CustomerCity] [varchar](50) NOT NULL,&lt;br /&gt; CONSTRAINT [PK_TblCustomerAddress] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt;      [CustomerId] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY &lt;br /&gt;&lt;br /&gt;= OFF, &lt;br /&gt;ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;&lt;br /&gt;4.    Use the following listing below in order to insert some records &lt;br /&gt;&lt;br /&gt;in the order tables.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Listing 2&lt;/span&gt; - T-SQL to insert data into the customer address table using &lt;br /&gt;&lt;br /&gt;the row constructor method&lt;br /&gt;&lt;br /&gt;Insert into TblCustomerAddress (CustomerId, CustomerContinent, &lt;br /&gt;&lt;br /&gt;CustomerCountry, &lt;br /&gt;CustomerCity)&lt;br /&gt;Values (1,&#39;America&#39;,&#39;USA&#39;,&#39;Florida&#39;),&lt;br /&gt;            (2,&#39;America&#39;,&#39;USA&#39;,&#39;Kansas&#39;),&lt;br /&gt;            (3,&#39;Asia&#39;,&#39;Lebanon&#39;,&#39;Florida&#39;),&lt;br /&gt;            (4,&#39;Asia&#39;,&#39;KSA&#39;,&#39;Riyad&#39;),&lt;br /&gt;            (5,&#39;Europe&#39;,&#39;France&#39;,&#39;Paris&#39;),&lt;br /&gt;            (6,&#39;Europe&#39;,&#39;Greate Britan&#39;,&#39;Paris&#39;)&lt;br /&gt;&lt;br /&gt;5.    Suppose your manager came in and said, &quot;I want a count of our &lt;br /&gt;&lt;br /&gt;customer addresses according to a count by continent, a count by &lt;br /&gt;&lt;br /&gt;country, a count by city and a total count.&quot; In order to do this &lt;br /&gt;&lt;br /&gt;before, you would have had to write a list of 4 queries as listed in &lt;br /&gt;&lt;br /&gt;the example below.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Listing 3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;--Count the customer by Continent&lt;br /&gt;Select CustomerContinent, COUNT(*) From TblCustomerAddress&lt;br /&gt;Group By CustomerContinent&lt;br /&gt; &lt;br /&gt;--Count the customer by Country&lt;br /&gt;Select CustomerCountry, COUNT(*) From TblCustomerAddress&lt;br /&gt;Group By CustomerCountry&lt;br /&gt; &lt;br /&gt;--Count the customer by City&lt;br /&gt;Select CustomerCity, COUNT(*) From TblCustomerAddress&lt;br /&gt;group By CustomerCity&lt;br /&gt; &lt;br /&gt;-- Count All Customers&lt;br /&gt;Select COUNT(*) From TblCustomer&lt;br /&gt;&lt;br /&gt;6.    How to solve the problem? SQL Server&lt;br /&gt;2008 provided the grouping sets to do this. The grouping sets feature &lt;br /&gt;&lt;br /&gt;allows having different grouping in the same SQL Statement&lt;br /&gt;. The listing below shows the statement.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Listing 4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT CustomerCity, CustomerCountry, CustomerContinent, Count(*) AS &lt;br /&gt;&lt;br /&gt;Count&lt;br /&gt;FROM TblCustomerAddress&lt;br /&gt;GROUP BY GROUPING SETS (&lt;br /&gt;      (CustomerCity),&lt;br /&gt;      (CustomerCountry),&lt;br /&gt;      (CustomerContinent),&lt;br /&gt;      ()&lt;br /&gt;)&lt;br /&gt;ORDER BY CustomerCity, CustomerCountry, CustomerContinent&lt;br /&gt;&lt;br /&gt;7.    This statement would return all results combined and ordered. The &lt;br /&gt;&lt;br /&gt;first grouping is done by customer city, the second is by customer &lt;br /&gt;&lt;br /&gt;country, the third one is by customer continent, while the last one is &lt;br /&gt;&lt;br /&gt;for the total of the table. So there is no grouping by a field done &lt;br /&gt;&lt;br /&gt;here.</description><link>http://dotnetnsql.blogspot.com/2009/04/grouping-sets-in-sql-server-2008.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-4536188343864807969</guid><pubDate>Fri, 17 Apr 2009 10:21:00 +0000</pubDate><atom:updated>2009-04-17T03:37:02.922-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>Table-Value Parameter in Storedprocedure - SQL SERVER -2008</title><description>Pass multiple rows of a table as a parameter to a stored procedure.&lt;br /&gt;&lt;br /&gt;Create a Table variable type in MSSQL and use it in the same way you &lt;br /&gt;&lt;br /&gt;use an integer data type. You can pass this variable to any stored &lt;br /&gt;&lt;br /&gt;procedure and use its contents or even update its contents and return &lt;br /&gt;&lt;br /&gt;it back.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;How we use?:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;1.&lt;/span&gt;    Open Microsoft SQL Server Management Studio.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;2.&lt;/span&gt;    Right click the database DbWork and choose query window.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;3.&lt;/span&gt;    Use the listing below to create an employee table as well as &lt;br /&gt;&lt;br /&gt;employee skill table.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Listing 1&lt;/span&gt; - T-SQL to create the employee table as well as employee &lt;br /&gt;&lt;br /&gt;skills table&lt;br /&gt;&lt;br /&gt;Create Table TblEmployee&lt;br /&gt;(EmployeeId int primary key,&lt;br /&gt; EmployeeName varchar(50))&lt;br /&gt; &lt;br /&gt;Create Table TblEmpSkills&lt;br /&gt;(EmployeeId int,&lt;br /&gt; EmployeeSkill varchar(50),&lt;br /&gt; AcquiredSince date)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;4.&lt;/span&gt;    Use the following listing below in order to insert some records &lt;br /&gt;&lt;br /&gt;in the employee table.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Listing 2&lt;/span&gt; - T-SQL to insert data into the employee table using the row &lt;br /&gt;&lt;br /&gt;constructor method&lt;br /&gt;&lt;br /&gt;Insert Into TblEmployee (EmployeeId, EmployeeName)&lt;br /&gt; Values (1,&#39;Asha Patel&#39;),&lt;br /&gt;            (2,&#39;Kamal Chaurasia&#39;),&lt;br /&gt;            (3,&#39;Tushar Jadhav&#39;),&lt;br /&gt;            (4,&#39;Kiran Patel&#39;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;5.&lt;/span&gt;    The idea now is that each employee can have multiples skills &lt;br /&gt;&lt;br /&gt;attached to him. We are going to implement the solution using table-&lt;br /&gt;&lt;br /&gt;value parameter.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;6.&lt;/span&gt;    We first need to create the table-value parameter. Listing 3 &lt;br /&gt;&lt;br /&gt;shows the creation of the SkillTable variable.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Listing 3&lt;/span&gt; - T-SQL to create the SkillTable variable&lt;br /&gt;&lt;br /&gt;Create Type  SkillTable as Table&lt;br /&gt;(EmployeeId int, EmployeeSkill varchar(50))&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;7. &lt;/span&gt;   Now, we declare a variable of type SkillTable and fill it with &lt;br /&gt;&lt;br /&gt;data. Check Listing 4.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Listing 4&lt;/span&gt; - T-SQL to create declare a variable of SkillTable and fill &lt;br /&gt;&lt;br /&gt;Data&lt;br /&gt;&lt;br /&gt;Declare @EmpSkills as SkillTable&lt;br /&gt;Insert Into @EmpSkills (EmployeeId, EmployeeSkill)&lt;br /&gt;Values (1,&#39;.NET&#39;),&lt;br /&gt;            (1,&#39;SQL&#39;),&lt;br /&gt;            (2,&#39;All&#39;),&lt;br /&gt;            (3,&#39;Sales&#39;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;8.&lt;/span&gt;    Now, it is time to create a stored procedure that would use the &lt;br /&gt;&lt;br /&gt;EmpSkills as a passed variable. Listing 5 shows the use of this &lt;br /&gt;&lt;br /&gt;variable to bulk insert the skills using the variable. Please note the &lt;br /&gt;&lt;br /&gt;read only attribute next to the variable name prohibits the stored &lt;br /&gt;&lt;br /&gt;procedure from modifying the content of the table-value parameter.&lt;br /&gt;&lt;br /&gt;Listing 5 - T-SQL Shows the complete usage of the data type table value&lt;br /&gt;&lt;br /&gt;CREATE PROCEDURE AssociateSkills&lt;br /&gt;    @SkillList SkillTable READONLY&lt;br /&gt;AS &lt;br /&gt;    INSERT INTO TblEmpSkills (EmployeeID, EmployeeSkill, AcquiredSince)&lt;br /&gt;      SELECT EmployeeId, EmployeeSkill, GETDATE() FROM  @SkillList;&lt;br /&gt; &lt;br /&gt;Declare @EmpSkills as SkillTable&lt;br /&gt; &lt;br /&gt;Insert Into @EmpSkills (EmployeeId, EmployeeSkill)&lt;br /&gt;Values (1,&#39;.NET&#39;),&lt;br /&gt;            (1,&#39;SQL&#39;),&lt;br /&gt;            (2,&#39;VB&#39;),&lt;br /&gt;            (3,&#39;Dot Net&#39;)&lt;br /&gt;Execute AssociateSkills @EmpSkills&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;The table value parameter would solve the problem of sending multiple row values and will also, to a certain extent, replace the temporary table because they can be sent between stored procedures.&lt;/span&gt;</description><link>http://dotnetnsql.blogspot.com/2009/04/table-value-parameter-in.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-1060149830740826457</guid><pubDate>Wed, 15 Apr 2009 10:57:00 +0000</pubDate><atom:updated>2009-04-15T04:27:36.167-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>UNIQUEIDENTIFIER vs.TIMESTAMP</title><description>In SQL Server, UNIQUEIDENTIFIER and TIMESTAMP are data type.&lt;br /&gt;&lt;br /&gt;* &lt;span style=&quot;font-weight:bold;&quot;&gt;* Size : &lt;/span&gt;Size of TIMESTAMP  is 8 bytes - Size of UNIQUEIDENTIFIER is 16 bytes&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;* Value : &lt;/span&gt;TIMESTAMP is not based on system date or time - UNIQUEIDENTIFIER value is based on the computer&#39;s MAC addresses and system date time.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;* Purpose : &lt;/span&gt; &lt;br /&gt;         TIMESTAMP   - To track the operation in tables on the database level&lt;br /&gt;         UNIQUEIDENTIFIER  -To unique value assigned to a row (maybe as primary key).&lt;br /&gt;                             It remains unique in any system in the world</description><link>http://dotnetnsql.blogspot.com/2009/04/uniqueidentifier-vstimestamp.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-2626039699696843016</guid><pubDate>Wed, 15 Apr 2009 10:46:00 +0000</pubDate><atom:updated>2009-04-15T04:27:54.385-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>TIMESTAMP</title><description>TIMESTAMP contains binary format string to denote a version of a row in table. so it is also called ROWVERSION.&lt;br /&gt;&lt;br /&gt;A timestamp is a sequence of characters, denoting the date and/or time at which a certain event occurred.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Create Table:&lt;/span&gt;&lt;br /&gt;CREATE TABLE TestTable(RowID INT IDENTITY(1,1) NOT NULL,&lt;br /&gt;TIMESTAMP, [SmallDateTime] SMALLDATETIME,&lt;br /&gt;[DateTime]  DATETIME)&lt;br /&gt;&lt;br /&gt;Table can have only one TIMESTAMP column. We can have either of a TIMESTAMP or ROWVERSION column type in table, but not both&lt;br /&gt;&lt;br /&gt;Benefit of TIMESTAMP in multi-user access on TABLE.&lt;br /&gt;&lt;br /&gt;Row-versioning can be used to examine the changes in table. It can also help to manage the synchronization in multiuse access.&lt;br /&gt;If two user work on same table at the same time.&lt;br /&gt;both A and B checks if the already read TIMESTAMP value still matches the TIMESTAMP value of the same row in the table, then they can go for update. If the TIMESTAMP value differs then it means another user has already modified that row, so it requires reading that table.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;we do not need to update a timestamp column value manually&lt;/span&gt;</description><link>http://dotnetnsql.blogspot.com/2009/04/timestamp.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-327291391691378370</guid><pubDate>Wed, 15 Apr 2009 10:01:00 +0000</pubDate><atom:updated>2009-04-15T03:32:05.177-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dot Net</category><title>Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.</title><description>Opening a database connection is a resource intensive and time consuming operation. Connection pooling increases the performance of Web applications by reusing active database connections instead of creating a new connection with every request. Connection pool manager maintains a pool of open database connections. When a new connection requests come in, the pool manager checks if the pool contains any unused connections and returns one if available. If all connections currently in the pool are busy and the maximum pool size has not been reached, the new connection is created and added to the pool. When the pool reaches its maximum size all new connection requests are being queued up until a connection in the pool becomes available or the connection attempt times out.&lt;br /&gt;&lt;br /&gt;Connection pooling behavior is controlled by the connection string parameters. The following are four parameters that control most of the connection pooling behavior:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Connect Timeout&lt;/span&gt; - controls the wait period in seconds when a new connection is requested, if this timeout expires, an exception will be thrown. Default is 15 seconds.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Max Pool Size&lt;/span&gt; - specifies the maximum size of your connection pool. Default is 100. Most Web sites do not use more than 40 connections under the heaviest load but it depends on how long your database operations take to complete.&lt;br /&gt;Min Pool Size - initial number of connections that will be added to the pool upon its creation. Default is zero; however, you may chose to set this to a small number such as 5 if your application needs consistent response times even after it was idle for hours. In this case the first user requests won&#39;t have to wait for those database connections to establish.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Pooling&lt;/span&gt; - controls if your connection pooling on or off. Default as you may&#39;ve guessed is true. Read on to see when you may use Pooling=false setting.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For Solve this Problem, set connect timeout period,pooling and max pool size in Sql Connection string in web.config file.&lt;br /&gt;&lt;br /&gt;Like &lt;br /&gt;&lt;br /&gt;&lt; add key=&quot;connstring&quot; value=&quot;Server=NILSON1;UID=sa;PWD=;database=final_database;Connect Timeout=90000; pooling=&#39;true&#39;; Max Pool Size=70000 &quot; / &gt;</description><link>http://dotnetnsql.blogspot.com/2009/04/timeout-expired-timeout-period-elapsed.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-1044312282724245816</guid><pubDate>Wed, 15 Apr 2009 07:20:00 +0000</pubDate><atom:updated>2009-04-15T03:37:46.302-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dot Net</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>SQL Connection String OR Access Connection String  OR  How to Get Database Connection String</title><description>When Your Are confuse in database connection string.&lt;br /&gt;&lt;br /&gt;use this simple way.&lt;br /&gt;&lt;br /&gt;1.first create one text file. &lt;br /&gt;2.rename with conn. txt&lt;br /&gt;3.now change the extension. Extention name is .udl &lt;br /&gt;4. now your file name is conn.udl&lt;br /&gt;5. Open the conn.udl file&lt;br /&gt;6. u will show data link property &lt;br /&gt;7. select provider name in provider tab(for Sql Server database , select &quot;Microsoft OLE DB Provider for SQL Server&quot;)&lt;br /&gt;8. then click on connection tab&lt;br /&gt;9. select database source name,enter user name,password and database name&lt;br /&gt;10. Click on text connection. if you get succeed message.&lt;br /&gt;11. open conn.udl file in text or notepage. You will get connection string&lt;br /&gt;     like &quot;Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=BusinessCoupon;Data Source=NILSON1&quot;</description><link>http://dotnetnsql.blogspot.com/2009/04/sql-connection-string-or-acess.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-8107560335492644446</guid><pubDate>Wed, 01 Apr 2009 09:27:00 +0000</pubDate><atom:updated>2009-04-15T03:32:58.559-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>Mail Alert Process  Or  Set Scheduler in SQL Database</title><description>Mail Alert Process in  SQL Server Database &lt;br /&gt;This Process called Scheduler.&lt;br /&gt;when you want to set scheduler in database which checks specific time automatically and send mail to those users whose criteria are match,set Job Functionality in Management tools in SQL server 2000&lt;br /&gt;&lt;br /&gt;Steps are Here....&lt;br /&gt;&lt;br /&gt;First, open sql server 2000. open Management tools.then open jobs. create new jobs.&lt;br /&gt;&lt;br /&gt;there are 4 tabs.&lt;br /&gt;1) General:&lt;br /&gt;- Give name like (beforeads)&lt;br /&gt;- category(uncategorized(local))&lt;br /&gt;- owner(NILSON1\Nilson)&lt;br /&gt;- description(anything)&lt;br /&gt;&lt;br /&gt;2) step:&lt;br /&gt;-&gt; new &lt;br /&gt; -&gt;Generel:&lt;br /&gt;  - step name like(stepads) &lt;br /&gt;  - Type like (Activexscript)&lt;br /&gt;  - Database like (classified)&lt;br /&gt;  - command like(vbscript codding (shaow dailymail.atxt))&lt;br /&gt;3) schedule:&lt;br /&gt;- name like(scheduleads)&lt;br /&gt;- and also set time&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If u need more help...put your questions...i will reply u...</description><link>http://dotnetnsql.blogspot.com/2009/04/mail-alert-process-or-set-scheduler-in.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-9098303962734884746</guid><pubDate>Sat, 28 Mar 2009 09:05:00 +0000</pubDate><atom:updated>2009-04-15T03:33:14.532-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>Does Not Allow Remote Connection For SQL Server</title><description>when we can&#39;t access our sql on another computer which is Connect in Network then Check Permition of Remote connection access.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Allow Remote Connection Using below Path&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Start -&gt;ProgramFiles -&gt;Sql Server 2005 -&gt; Configuration Tools -&gt; SQL Server Surface Area Configuration --&gt;Surface Area Configuration For Services and Connections -&gt; MSSQLSERVER -&gt; Database Engine -&gt;Remote Connection  &lt;br /&gt;&lt;br /&gt;- and then Give permition on Local and Remote Connection  and Using TCP/IP Only</description><link>http://dotnetnsql.blogspot.com/2009/03/does-not-allow-remote-connection-for.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-3619433207662781026</guid><pubDate>Wed, 25 Mar 2009 06:38:00 +0000</pubDate><atom:updated>2009-03-27T23:09:49.913-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dot Net</category><title>- IIS installed after visual studio 2005 not working  -   IIS installation after visual 2005 install</title><description>Hello Friends,&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;after visual 2005 installation, if u have not installed IIS First and U have install Visual 2005  first. then IIS not working perfect.&lt;/div&gt;&lt;div&gt;U have face this problem?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No worry...try below process.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First run command prompt using&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;start menu -&gt; Run -&gt; write cmd -&gt; Enter&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then  write below link in your command prompt&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;C:\windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then Enter.&lt;br /&gt;&lt;!-- Begin: AdBrite, Generated: 2009-03-28 2:08:28  --&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;&lt;br /&gt;   .adHeadline {font: bold 10pt Arial; text-decoration: underline; color: #0000FF;}&lt;br /&gt;   .adText {font: normal 10pt Arial; text-decoration: none; color: #000000;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;br /&gt;try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==&#39;&#39;?document.location:document.referrer;AdBrite_Referrer=encodeURIComponent(AdBrite_Referrer);}catch(e){var AdBrite_Iframe=&#39;&#39;;var AdBrite_Referrer=&#39;&#39;;}&lt;br /&gt;document.write(String.fromCharCode(60,83,67,82,73,80,84));document.write(&#39; src=&quot;http://ads.adbrite.com/mb/text_group.php?sid=1102745&amp;br=1&amp;dk=726567697374657220646f6d61696e5f355f325f776562&amp;ifr=&#39;+AdBrite_Iframe+&#39;&amp;ref=&#39;+AdBrite_Referrer+&#39;&quot; type=&quot;text/javascript&quot;&gt;&#39;);document.write(String.fromCharCode(60,47,83,67,82,73,80,84,62));&lt;/script&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;!-- End: AdBrite --&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://dotnetnsql.blogspot.com/2009/03/iis-installation-after-visual-2005.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-5025000650549348563</guid><pubDate>Sat, 24 Jan 2009 06:29:00 +0000</pubDate><atom:updated>2009-03-25T23:06:00.813-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dot Net</category><title>Server Error in &#39;/&#39; Application - Validation of viewstate MAC failed error  OR  how to solve Mac Failed Error</title><description>&lt;div&gt;&lt;div&gt;This error occured when server can&#39;t read fast  view state value&lt;/div&gt;&lt;div&gt;//use this tag in web config file in &lt; system.web &gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt; system.web &gt;&lt;/div&gt;&lt;div&gt;&lt; enableeventvalidation=&quot;false&quot;&gt;&lt;div&gt;    viewstateencryptionmode=&quot;Never&quot; &gt;&lt;/div&gt;&lt;div&gt;&lt; / system.web &gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://dotnetnsql.blogspot.com/2009/01/how-to-solve-mac-failed-error.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-626309663935825914</guid><pubDate>Tue, 06 Jan 2009 11:28:00 +0000</pubDate><atom:updated>2009-03-25T23:09:11.409-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dot Net</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>Get return value in asp.net From SQL server</title><description>step1 : create stored procedure&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;CREATE  PROCEDURE dyntable (@ptable varchar(50),@new_var int  Output )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;AS&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt; Select @new_var=count(*) from admin_master&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;return @new_var&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;step 2:  Retrive in asp.net&lt;/div&gt;&lt;div&gt;&lt;div&gt; public void CreatefieldListTable(string strtablename)&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;        string intconfirm = &quot;&quot;;&lt;/div&gt;&lt;div&gt;      &lt;/div&gt;&lt;div&gt;        SqlConnection conn = new SqlConnection(objconn.GetConnection());&lt;/div&gt;&lt;div&gt;        SqlCommand cmdInsert = new SqlCommand(&quot;dyntable&quot;, conn);&lt;/div&gt;&lt;div&gt;        cmdInsert.CommandType = CommandType.StoredProcedure;&lt;/div&gt;&lt;div&gt;        cmdInsert.Parameters.AddWithValue(&quot;@ptable&quot;, strtablename);              &lt;/div&gt;&lt;div&gt;        SqlParameter var =new SqlParameter(&quot;@new_var&quot;,SqlDbType.Int); &lt;/div&gt;&lt;div&gt;        var.Direction = ParameterDirection.Output;&lt;/div&gt;&lt;div&gt;        cmdInsert.Parameters.Add(var);&lt;/div&gt;&lt;div&gt;        conn.Open();&lt;/div&gt;&lt;div&gt;        SqlDataReader dtread;&lt;/div&gt;&lt;div&gt;        cmdInsert.ExecuteNonQuery();&lt;/div&gt;&lt;div&gt;        string str = Convert.ToString(cmdInsert.Parameters[&quot;@new_var&quot;].Value);       &lt;/div&gt;&lt;div&gt;        conn.Close();&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://dotnetnsql.blogspot.com/2009/01/get-return-value-in-aspnet-from-sql.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-5451746621836172584</guid><pubDate>Mon, 05 Jan 2009 07:01:00 +0000</pubDate><atom:updated>2009-03-24T23:54:19.115-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>Delete all User stored procedure from  SQL Server</title><description>&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;hello friends.... if u want to try this code  then first take bakup your database.becauze all user stored procedures will be deleted after this query.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;step 1: for  check your  all stored procedure name. run in query analyzer&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT name FROM sys.objects where type_desc =&#39;SQL_STORED_PROCEDURE&#39;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;step 2: if step 1 is correct then run below code in query analyzer&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Declare @sql Varchar(500)&lt;/div&gt;&lt;div&gt;Declare @get_table varchar(100)&lt;/div&gt;&lt;div&gt;DECLARE s_gettable CURSOR FOR SELECT name FROM sys.objects where type_desc =&#39;SQL_STORED_PROCEDURE&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;              &lt;/div&gt;&lt;div&gt;     OPEN s_gettable&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;FETCH NEXT FROM s_gettable INTO @get_table&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;WHILE @@FETCH_STATUS = 0&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;BEGIN&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;             &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;           BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;Set @sql=&#39;drop procedure dbo.&#39;+@get_table&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;exec(@sql)&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;           END&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt; FETCH NEXT FROM s_gettable INTO @get_table &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;END    &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;CLOSE s_gettable&lt;/div&gt;&lt;div&gt;    DEALLOCATE s_gettable&lt;/div&gt;&lt;/div&gt;</description><link>http://dotnetnsql.blogspot.com/2009/01/how-to-delete-all-user-stored-procedure.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-8364616094276495933</guid><pubDate>Tue, 30 Dec 2008 10:00:00 +0000</pubDate><atom:updated>2008-12-30T02:31:04.996-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dot Net</category><title>How to use different Server Variables</title><description>:  the page the visitor came from.&lt;div&gt;Request.ServerVariables(&quot;HTTP_REFERER&quot;)&lt;br /&gt;: get a visitors IP address&lt;/div&gt;&lt;div&gt;Request.ServerVariables(&quot;REMOTE_ADDR&quot;)&lt;br /&gt;:Find host name of client&lt;/div&gt;&lt;div&gt;Request.ServerVariables(&quot;REMOTE_HOST&quot;)&lt;/div&gt;&lt;div&gt;: Find server domain name&lt;/div&gt;&lt;div&gt;&lt;div&gt;Request.ServerVariables(&quot;SERVER_NAME&quot;)&lt;br /&gt;&lt;/div&gt;&lt;div&gt;: returns the software running on the server&lt;/div&gt;&lt;div&gt; Request.ServerVariables(&quot;SERVER_SOFTWARE&quot;)%&lt;/div&gt;&lt;div&gt;:Display the virtual path to the script or application being executed&lt;/div&gt;&lt;div&gt;Request.ServerVariables(&quot;SCRIPT_NAME&quot;) &lt;br /&gt;&lt;/div&gt;&lt;div&gt;:Display users browser and opertaing system&lt;br /&gt;&lt;/div&gt;&lt;div&gt; Request.ServerVariables(&quot;HTTP_USER_AGENT&quot;) &lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://dotnetnsql.blogspot.com/2008/12/how-to-use-different-server-variables.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-5255828389672554289</guid><pubDate>Tue, 30 Dec 2008 09:46:00 +0000</pubDate><atom:updated>2008-12-30T01:52:08.091-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dot Net</category><title>how to send a mail message from a Web Forms page</title><description>step 1:  Import System.Web.Mail  Namespace  in Html Code&lt;br /&gt;&lt;br /&gt;step 2 : add  below code in  script tag  using script language C#&lt;br /&gt;&lt;br /&gt;void Page_Load()&lt;br /&gt; {&lt;br /&gt;    if (!IsPostBack)&lt;br /&gt;    {&lt;br /&gt;       txtTo.Text=&quot;john@contoso.com&quot;;&lt;br /&gt;       txtFrom.Text=&quot;marsha@contoso.com&quot;;&lt;br /&gt;       txtCc.Text=&quot;fred@contoso.com&quot;;&lt;br /&gt;       txtBcc.Text=&quot;wilma@contoso.com&quot;;&lt;br /&gt;       txtSubject.Text=&quot;Hello&quot;;&lt;br /&gt;       txtBody.Text=&quot;This is a test message.&quot;;&lt;br /&gt;       txtAttach.Text=@&quot;C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg,&quot;&lt;br /&gt;          + @&quot;C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Winter.jpg&quot;;&lt;br /&gt;   txtBodyEncoding.Text = Encoding.ASCII.EncodingName;&lt;br /&gt;   txtBodyFormat.Text=&quot;HTML&quot;;&lt;br /&gt;   txtPriority.Text=&quot;Normal&quot;;&lt;br /&gt;   txtUrlContentBase.Text=&quot;http://www.contoso.com/images&quot;;&lt;br /&gt;   txtUrlContentLocation.Text=&quot;http://www.contoso.com/images&quot;;&lt;br /&gt;       // Name of relay mail server in your domain.&lt;br /&gt;   txtMailServer.Text=&quot;smarthost&quot;;&lt;br /&gt;    }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; void btnSubmit_Click(Object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;    string sTo, sFrom, sSubject, sBody;&lt;br /&gt;    string sAttach, sCc, sBcc, sBodyEncoding;&lt;br /&gt;    string sBodyFormat, sMailServer, sPriority;&lt;br /&gt;    string sUrlContentBase, sUrlContentLocation;&lt;br /&gt;int iLoop1;&lt;br /&gt;&lt;br /&gt;sTo = txtTo.Text.Trim();&lt;br /&gt;sFrom = txtFrom.Text.Trim();&lt;br /&gt;sSubject = txtSubject.Text.Trim();&lt;br /&gt;sBody = txtBody.Text.Trim();&lt;br /&gt;sAttach = txtAttach.Text.Trim();&lt;br /&gt;sCc = txtCc.Text.Trim();&lt;br /&gt;sBcc = txtBcc.Text.Trim();&lt;br /&gt;sBodyFormat = txtBodyFormat.Text.Trim();&lt;br /&gt;sBodyEncoding = txtBodyEncoding.Text.Trim();&lt;br /&gt;sPriority = txtPriority.Text.Trim();&lt;br /&gt;sUrlContentBase = txtUrlContentBase.Text.Trim();&lt;br /&gt;sUrlContentLocation = txtUrlContentLocation.Text.Trim();&lt;br /&gt;sMailServer = txtMailServer.Text.Trim();&lt;br /&gt;&lt;br /&gt;MailMessage MyMail = new MailMessage();&lt;br /&gt;MyMail.From = sFrom;&lt;br /&gt;MyMail.To = sTo;&lt;br /&gt;MyMail.Subject = sSubject;&lt;br /&gt;MyMail.Body = sBody;&lt;br /&gt;MyMail.Cc = sCc;&lt;br /&gt;MyMail.Bcc = sBcc;&lt;br /&gt;MyMail.UrlContentBase = sUrlContentBase;&lt;br /&gt;MyMail.UrlContentLocation = sUrlContentLocation;&lt;br /&gt;&lt;br /&gt;    if (txtBodyEncoding.Text == Encoding.UTF7.EncodingName)&lt;br /&gt;       MyMail.BodyEncoding = Encoding.UTF7;&lt;br /&gt;    else if (txtBodyEncoding.Text == Encoding.UTF8.EncodingName)&lt;br /&gt;       MyMail.BodyEncoding = Encoding.UTF8;&lt;br /&gt;    else&lt;br /&gt;       MyMail.BodyEncoding = Encoding.ASCII;&lt;br /&gt;&lt;br /&gt;switch (sBodyFormat.ToUpper())&lt;br /&gt;    {&lt;br /&gt;       case &quot;HTML&quot;:&lt;br /&gt;          MyMail.BodyFormat = MailFormat.Html;&lt;br /&gt;          break;&lt;br /&gt;       default:&lt;br /&gt;          MyMail.BodyFormat = MailFormat.Text;&lt;br /&gt;          break;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    switch (sPriority.ToUpper())&lt;br /&gt;    {&lt;br /&gt;       case &quot;HIGH&quot;:&lt;br /&gt;          MyMail.Priority = MailPriority.High;&lt;br /&gt;          break;&lt;br /&gt;       case &quot;LOW&quot;:&lt;br /&gt;          MyMail.Priority = MailPriority.Low;&lt;br /&gt;          break;&lt;br /&gt;       default:&lt;br /&gt;          MyMail.Priority = MailPriority.Normal;&lt;br /&gt;          break;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Build an IList of mail attachments.&lt;br /&gt;    if (sAttach != &quot;&quot;)&lt;br /&gt;    {&lt;br /&gt;       char[] delim = new char[] {&#39;,&#39;};&lt;br /&gt;       foreach (string sSubstr in sAttach.Split(delim))&lt;br /&gt;       {&lt;br /&gt;          MailAttachment MyAttachment = new MailAttachment(sSubstr);&lt;br /&gt;          MyMail.Attachments.Add(MyAttachment);&lt;br /&gt;       }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    SmtpMail.SmtpServer = sMailServer;&lt;br /&gt;SmtpMail.Send(MyMail);&lt;br /&gt;lblMsg1.Text=&quot;C# Message sent to &quot; + MyMail.To;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; void btnClear_Click(Object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;    lblMsg1.Text=&quot;&quot;;&lt;br /&gt;    txtTo.Text=&quot;&quot;;&lt;br /&gt;    txtFrom.Text=&quot;&quot;;&lt;br /&gt;    txtSubject.Text=&quot;&quot;;&lt;br /&gt;    txtBody.Text=&quot;&quot;;&lt;br /&gt;    txtAttach.Text=&quot;&quot;;&lt;br /&gt;    txtBcc.Text=&quot;&quot;;&lt;br /&gt;    txtCc.Text=&quot;&quot;;&lt;br /&gt;txtBodyEncoding.Text=&quot;&quot;;&lt;br /&gt;txtBodyFormat.Text=&quot;&quot;;&lt;br /&gt;txtPriority.Text=&quot;&quot;;&lt;br /&gt;txtUrlContentBase.Text=&quot;&quot;;&lt;br /&gt;txtUrlContentLocation.Text=&quot;&quot;;&lt;br /&gt;txtMailServer.Text=&quot;&quot;;&lt;br /&gt;    btnSubmit.Text=&quot;Submit&quot;;&lt;br /&gt; }&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://dotnetnsql.blogspot.com/2008/12/how-to-send-mail-message-from-web-forms_30.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-6883250161079403361</guid><pubDate>Tue, 23 Dec 2008 09:50:00 +0000</pubDate><atom:updated>2009-03-26T23:15:01.288-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>Get stored procedure list from Server Using cursor</title><description>SELECT name FROM sys.objects where type_desc =&#39;SQL_STORED_PROCEDURE&#39;</description><link>http://dotnetnsql.blogspot.com/2008/12/how-to-get-sql-user-stored-procedure.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1412349307459676978.post-2691429391100182524</guid><pubDate>Tue, 23 Dec 2008 09:29:00 +0000</pubDate><atom:updated>2008-12-23T02:44:00.708-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dot Net</category><title>How to get return value from SQl query thru Dot Net</title><description>&lt;div&gt;first create the &quot;dyntable &quot; procedure &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;CREATE  PROCEDURE dyntable (@new_var int  Output )&lt;/div&gt;&lt;div&gt;AS&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;   Select @new_var=count(*) from admin_master&lt;br /&gt;&lt;/div&gt;&lt;div&gt;   return @new_var&lt;/div&gt;&lt;div&gt;END&lt;br /&gt;&lt;/div&gt;&lt;div&gt;GO&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Get return value in Asp.Net &lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        string intconfirm = &quot;&quot;;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;      &lt;/div&gt;&lt;div&gt;        SqlConnection conn = new SqlConnection(objconn.GetConnection());&lt;/div&gt;&lt;div&gt;        SqlCommand cmdInsert = new SqlCommand(&quot;dyntable&quot;, conn);&lt;/div&gt;&lt;div&gt;        cmdInsert.CommandType = CommandType.StoredProcedure;&lt;/div&gt;&lt;div&gt;        SqlParameter var =new SqlParameter(&quot;@new_var&quot;,SqlDbType.Int); &lt;/div&gt;&lt;div&gt;        var.Direction = ParameterDirection.Output;&lt;/div&gt;&lt;div&gt;        cmdInsert.Parameters.Add(var);&lt;/div&gt;&lt;div&gt;        conn.Open();&lt;/div&gt;&lt;div&gt;        SqlDataReader dtread;&lt;/div&gt;&lt;div&gt;        cmdInsert.ExecuteNonQuery();&lt;/div&gt;&lt;div&gt;        string str = Convert.ToString(cmdInsert.Parameters[&quot;@new_var&quot;].Value);       &lt;/div&gt;&lt;div&gt;        conn.Close();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://dotnetnsql.blogspot.com/2008/12/hi.html</link><author>noreply@blogger.com (ashapatel)</author><thr:total>1</thr:total></item></channel></rss>