A string is a sequence of characters that are treated as text.
Wednesday, 27 July 2011
Monday, 25 July 2011
Threads
Thread th = new Thread(Fill_IgGrid);
th.Priority = ThreadPriority.Normal;
th.IsBackground = true;
th.Start(_List); //object of the parameter (_Generic List)
or
th.Start(); // non of parameter
private void Fill_IgGrid()
{
//------- Grid bind code
}
th.Priority = ThreadPriority.Normal;
th.IsBackground = true;
th.Start(_List); //object of the parameter (_Generic List)
or
th.Start(); // non of parameter
private void Fill_IgGrid()
{
//------- Grid bind code
}
Saturday, 23 July 2011
What is the purpose of XML Namespaces?
An XML Namespace is collection of element types and attribute names. It consists of two parts :
1) The first part is the URI used to identify the namespace
2) The second part is the element type or attribute name itself.
The various purpose of XML Namespace are
1. Combine fragments from different documents without any naming conflicts.
2. Write reusable code modules that can be invoked for specific elements and attributes. Universally unique names guarantee that
such modules are invoked only for the correct elements and attributes.
3. Define elements and attributes that can be reused in other schemas or instance documents without fear of name collisions.
1) The first part is the URI used to identify the namespace
2) The second part is the element type or attribute name itself.
The various purpose of XML Namespace are
1. Combine fragments from different documents without any naming conflicts.
2. Write reusable code modules that can be invoked for specific elements and attributes. Universally unique names guarantee that
such modules are invoked only for the correct elements and attributes.
3. Define elements and attributes that can be reused in other schemas or instance documents without fear of name collisions.
Friday, 22 July 2011
Can you encrypt view state data of an aspx page?
Yes, you encrypt view state data of an aspx page by setting the page's ViewStateEncryptionMode property to true.
What is the advantage of storing an XML file in the applications App_Data folder?
The contents of the App_Data folder will not be returned in response to direct HTTP requests.
What are the best practices to follow to secure connection strings in an ASP.NET web application?
1. Always store connection strings in the site's Web.config file. Web.config is very secure. Users will not be able to access web.config from the browser.
2. Do not store connection strings as plain text. To help keep the connection to your database server secure, it is recommended that you encrypt connection string information in the configuration file.
3. Never store connection strings in an aspx page.
4. Never set connection strings as declarative properties of the SqlDataSource control or other data source controls.Why is "Connecting to SQL Server using Integrated Security" considered a best practice?Connecting to SQL Server using integrated security instead of using an explicit user name and password, helps avoid the possibility of the connection string being compromised and your user ID and password being exposed.
2. Do not store connection strings as plain text. To help keep the connection to your database server secure, it is recommended that you encrypt connection string information in the configuration file.
3. Never store connection strings in an aspx page.
4. Never set connection strings as declarative properties of the SqlDataSource control or other data source controls.Why is "Connecting to SQL Server using Integrated Security" considered a best practice?Connecting to SQL Server using integrated security instead of using an explicit user name and password, helps avoid the possibility of the connection string being compromised and your user ID and password being exposed.
StreamReader and StreamWriter classes in .Net
Hi friends,in this post i would like to explain StreamReader & StreamWriter classes in C#.Net.
* StreamReader is used to read data from the file.
* StreamWriter is used to write data into the file.
* Directly we are not write data into the file. First we should write into RAM & then through flush() it will be written into the file.
StreamReader methods:
1)Read() : Reads single character.
2)ReadLine() : Reads single line.
3)ReadToEnd() : Reads full file.
For Example:
StreamReader str=new StreamReader(file1);
txtBox1.Text=str.ReadToEnd();
str.Close();
StreamWriter methods:
1)Write()
2)WriteLine()
For Example:
StreamWriter stw=new StreamWriter(file1);
stw.Write(txtBox1.Text);
stw.Flush();
stw.Close();
* StreamReader is used to read data from the file.
* StreamWriter is used to write data into the file.
* Directly we are not write data into the file. First we should write into RAM & then through flush() it will be written into the file.
StreamReader methods:
1)Read() : Reads single character.
2)ReadLine() : Reads single line.
3)ReadToEnd() : Reads full file.
For Example:
StreamReader str=new StreamReader(file1);
txtBox1.Text=str.ReadToEnd();
str.Close();
StreamWriter methods:
1)Write()
2)WriteLine()
For Example:
StreamWriter stw=new StreamWriter(file1);
stw.Write(txtBox1.Text);
stw.Flush();
stw.Close();
Subscribe to:
Posts (Atom)