public partial class HardwareInformation : BaseForm
{
string sWhere = "";
public HardwareInformation()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SqlConnection objConn1 = new SqlConnection("Data Source=192.168.0.203;Initial Catalog=costing;User ID=sa;Password=Spareage@123");
if ( searchtextbox.Text.Trim() != "" )
{
sWhere = "Where Srno " + searchtextbox.Text;
}
SqlDataAdapter objAdapter = new SqlDataAdapter(@"Select distinct [Srno] ,[Employee Name] , [Department] , [Thin Client] , [Desktop] , [Lcd] , [Moniter] , [Printer] , [Ups] from [dbo].[HardwareDetail] " + sWhere + "", objConn1);
DataTable objTable = new DataTable();
objAdapter.Fill(objTable);
dataGridView1.DataSource = objTable;
dataGridView1.Columns[0].Width = 25;
for (int i = 1; i < dataGridView1.Columns.Count; i++)
{
dataGridView1.Columns[i].ReadOnly = true;
}
}
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?