h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

SQL Server Naming conventions and Standards

Today , we will discuss about SQL Server Name Conventions and Standards

  1. Table >> tbl >>tblEmployees
  2. Primary Key Constraint >> PK >>PK_EmployeeId
  3. Foreign Key Constraint>> FK >> FK_Employeeid
  4. Unique Key Constraint>> UQ >>UQ_employee_EmailId
  5. Default Constraint >> DF >> DF_Employee_IsActive
  6. Check Constraint >> CHk >> CHK_Employee_DOB
  7. User defined Store Procedure >> usp Eg:usp_Insert_Employee
  8. User Defined Functions >> fn >> fn_CalculateAge
  9. Views >> vw >> vw_OrderDetails
  10. Triggers >> trg >> trg_Del_Employee
  11. Indexes >> IX >>IX_EmployeeEmailId

Supporting Namespace in Dotnet 4.5


S.NoParticular.Net 3.0.Net 3.5.Net 4.0.Net 4.5
1Microsoft.Build.Tasks.WindowsYYYY
2Microsoft.Win32YYYY
3Microsoft.Windows.ThemesYYYY
4System.Collections.ObjectModel YYYY
5System.Collections.SpecializedYYYY
6System.ComponentModel YYYY
7System.DiagnosticsYYYY
8System.IOYYYY
9System.IO.PackageYYYY
10System.PrintingYYYY
11System.Printing.IndexedPropertyYYYY
12System.Printing.InteropYYYY
13System.Security.PermissionsYYYY
14System.Security.RightsManagementYYYY
15System.WindowsYYYY
16System.Windows.AnnotationsYYYY
17System.Windows.Annotations.StorageYYYY
18System.Windows.AutomationYYYY
19System.Windows.Automation.PeersYYYY
20System.Windows.Automation.ProviderYYYY
21System.Windows.Automation.TextYYYY
22System.Windows.ControlsYYYY
23System.Windows.Controls.PrimitivesYYYY
24System.Windows.ConvertersYYYY
25System.Windows.DataYYYY
26System.Windows.DocumentsYYYY
27System.Windows.Documents.DocumentStructuresYYNY
28System.Windows.Documents.SerializationYYYY
29System.Windows.Forms.IntegrationYYYY
30System.Windows.InkYYYY
31System.Windows.InputYYYY
32System.Windows.Input.StylusPlugInsYYYY
33System.Windows.InteropYYYY
34System.Windows.Markup (shared)YYYY
35System.Windows.Markup.LocalizerYYYY
36System.Windows.Markup.PrimitivesYYYY
37System.Windows.MediaYYYY
38System.Windows.Media.AnimationYYYY
39System.Windows.Media.ConvertersYYYY
40System.Windows.Media.EffectsYYYY
41System.Windows.Media.ImagingYYYY
42System.Windows.Media.Media3DYYYY
43System.Windows.Media.Media3D.ConvertersYYYY
44System.Windows.Media.TextFormattingYYYY
45System.Windows.NavigationYYYY
46System.Windows.ResourcesYYYY
47System.Windows.ShapesYYYY
48System.Windows.ThreadingYYYY
49System.Windows.XpsYYYY
50System.Windows.Xps.PackagingYYYY
51System.Windows.Xps.SerializationYYYY
52UIAutomationClientsideProvidersYYYY

Supporting Namespace for Sliverlight in Net


S.NoParticularSliverlight
1 Microsoft.Win32 Y
2 Microsoft.Windows.Themes Y
3 System.Collections.ObjectModel Y
4 System.Collections.Specialized Y
5 System.ComponentModel Y
6 System.Diagnostics Y
7 System.IO Y
8 System.Security.Permissions Y
9 System.Windows Y
10 System.Windows.Automation Y
11 System.Windows.Automation.Peers Y
12 System.Windows.Automation.Provider Y
13 System.Windows.Automation.Text Y
14 System.Windows.Controls Y
15 System.Windows.Controls.Primitives Y
16 System.Windows.Data Y
17 System.Windows.Documents Y
18 System.Windows.Documents.DocumentStructures Y
19 System.Windows.Documents.Serialization Y
20 System.Windows.Forms.Integration Y
21 System.Windows.Ink Y
22 System.Windows.Input Y
23 System.Windows.Interop Y
24 System.Windows.Markup (shared) Y
25 System.Windows.Media Y
26 System.Windows.Media.Animation Y
27 System.Windows.Media.Effects Y
28 System.Windows.Media.Imaging Y
29 System.Windows.Media.Media3D Y
30 System.Windows.Navigation Y
31 System.Windows.Resources Y
32 System.Windows.Shapes Y
33 System.Windows.Threading Y


Calling Constructor from another Constructor

Yes , it is possible. Please check this link

Constructor in C#.net

              A constructor is a method in the class which gets executed when its object is created. Usually, we put the initialization code in the constructor. 

Validate Text Box

Introduction:
      Today, we discussed about How to validate Text Box with Error Provider in C#.Net? .
Conditions:
    TextBox should enter only integer.
    create one validation event for integer

Here the Code:
protected void textBox1_Validating (object sender,
   System.ComponentModel.CancelEventArgs e)
{
   try
   {
      int x = Int32.Parse(textBox1.Text);
      errorProvider1.SetError(textBox1, "");
   }
   catch (Exception ex)
   {
      errorProvider1.SetError(textBox1, "Not an integer value.");
   }
}

Call this event in constructor
this.textBox1.Validating += new
System.ComponentModel.CancelEventHandler(this.textBox1_Validating);

Valdating data in Dataset

  • Validating data is the process of confirming that the values being entered into data objects conform to the constraints within a dataset's schema, as well as the rules established for your application.
  • Validating data prior to sending updates to the underlying database is a good practice that reduces errors as well as the potential number of round trips between an application and the database.
  • You can confirm that data being written to a dataset is valid by building validation checks into the dataset itself.
  • The dataset can check the data no matter how the update is being performed — whether directly by controls in a form, within a component, or in some other way. Because the dataset is part of your application, it is a logical place to build application-specific validation (unlike building the same checks into the database backend).


TableAdapter in Windows Application

TableAdapter Overview:

  1. TableAdapters provide communication between your application and a database.
  2. TableAdapters are also used to send updated data from your application back to the database.
  3. ADO.NET Data Adapters were used for communicating between an application and a       database.
  4. TableAdapters typically contain Fill and Update methods to fetch and update data in a database.
  5. TableAdapters are created with the Dataset Designer inside of strongly typed datasets. 




Fill a dataset with data

  • The phrase "filling a dataset with data" refers to loading data into the individual DataTable objects that make up the dataset.
  • You fill the data tables by executing TableAdapter queries or by executing data adapter (for example, SqlDataAdapter) commands.


Local Temp Table vs Global Temp Table

Local Temp Table vs Global Temp Table
S.NoParticularsLocal Temp TableGlobal Temp Table
1Available SQL Server session or connection (means single user) all SQL Server sessions or connections (means all the user).
2deleted These are automatically deleted when the session that created the tables has been closedThese can be created by any SQL Server connection user and these are automatically deleted when all the SQL Server connections have been closed.
3stared with signLocal temporary table name is stared with single hash ("#") sign.Global temporary table name is stared with double hash ("##") sign.