Enterprise Library DAAB – ADO.NET and Stored Procedures Made Easy

using (DbConnection connection = factory.CreateConnection()) { connection.ConnectionString = connectionString;   using (DbCommand selectCommand = factory.CreateCommand()) { selectCommand.CommandType = CommandType.StoredProcedure; selectCommand.CommandText = "SalesByCategory"; selectCommand.Connection = connection;   DbParameter categoryParameter = selectCommand.CreateParameter(); categoryParameter.ParameterName = "@CategoryName"; categoryParameter.Value = "Beverages";   DbParameter yearParameter =…

Okumaya devam edinEnterprise Library DAAB – ADO.NET and Stored Procedures Made Easy

Enter Null Values for DateTime Column of SQL Server

C# string sqlStmt ; string conString ; SqlConnection cn =null; SqlCommand cmd =null; SqlDateTime sqldatenull ; try { sqlStmt = "insert into Emp (FirstName,LastName,Date) Values (@FirstName,@LastName,@Date) "; conString = "server=localhost;database=Northwind;uid=sa;pwd=;"; cn = new SqlConnection(conString);…

Okumaya devam edinEnter Null Values for DateTime Column of SQL Server