c# Programming Glossary: rdr
How to execute a stored procedure within C# program http://stackoverflow.com/questions/1260952/how-to-execute-a-stored-procedure-within-c-sharp-program void RunStoredProc SqlConnection conn null SqlDataReader rdr null Console.WriteLine nTop 10 Most Expensive Products n try.. conn cmd.CommandType CommandType.StoredProcedure rdr cmd.ExecuteReader while rdr.Read Console.WriteLine Product.. CommandType.StoredProcedure rdr cmd.ExecuteReader while rdr.Read Console.WriteLine Product 0 25 Price 1 6 ####.00 rdr..
Fastest method for SQL Server inserts, updates, selects http://stackoverflow.com/questions/2862428/fastest-method-for-sql-server-inserts-updates-selects sql cn addParameters cmd.Parameters cn.Open using var rdr cmd.ExecuteReader while rdr.Read yield return rdr rdr.Close.. cn.Open using var rdr cmd.ExecuteReader while rdr.Read yield return rdr rdr.Close And that lets me write public.. var rdr cmd.ExecuteReader while rdr.Read yield return rdr rdr.Close And that lets me write public data layer methods..
What is the difference between null and System.DBNull.Value? http://stackoverflow.com/questions/4958379/what-is-the-difference-between-null-and-system-dbnull-value If yes what is it I noticed this behavior now while rdr.Read if rdr Id null if rdr Id System.DBNull.Value int x Convert.ToInt32.. what is it I noticed this behavior now while rdr.Read if rdr Id null if rdr Id System.DBNull.Value int x Convert.ToInt32.. noticed this behavior now while rdr.Read if rdr Id null if rdr Id System.DBNull.Value int x Convert.ToInt32 rdr Id While..
Xml validation using XSD schema http://stackoverflow.com/questions/572853/xml-validation-using-xsd-schema new XmlDocument document.Load xmlFilePath XmlReader rdr XmlReader.Create new StringReader document.InnerXml settings.. new StringReader document.InnerXml settings while rdr.Read isValid true The ValidationEventHandler also tells me what..
“Invalid attempt to call Read when reader is closed” error (for lengthy operations only) http://stackoverflow.com/questions/6775136/invalid-attempt-to-call-read-when-reader-is-closed-error-for-lengthy-operatio CountOfUnchangedZipCode DbType.String 1000 DbDataReader rdr null try rdr DbDataReader db.ExecuteReader cmd if rdr.Read .. DbType.String 1000 DbDataReader rdr null try rdr DbDataReader db.ExecuteReader cmd if rdr.Read if String.IsNullOrEmpty.. rdr null try rdr DbDataReader db.ExecuteReader cmd if rdr.Read if String.IsNullOrEmpty Utility.GetString rdr NewZipCode..
Return DataReader from DataLayer in Using statement http://stackoverflow.com/questions/850065/return-datareader-from-datalayer-in-using-statement 255 .Value filter cn.Open using IDataReader rdr cmd.ExecuteReader while rdr.Read yield return IDataRecord.. cn.Open using IDataReader rdr cmd.ExecuteReader while rdr.Read yield return IDataRecord rdr This will work even better.. while rdr.Read yield return IDataRecord rdr This will work even better once we move to 3.5 and can start..
Force download of a file on web server - ASP .NET C# http://stackoverflow.com/questions/873207/force-download-of-a-file-on-web-server-asp-net-c-sharp code I am using string sql using System.IO.StreamReader rdr System.IO.File.OpenText fileName sql rdr.ReadToEnd Response.ContentType.. rdr System.IO.File.OpenText fileName sql rdr.ReadToEnd Response.ContentType text plain Response.AddHeader..
How to post JSON to the server? http://stackoverflow.com/questions/9145667/how-to-post-json-to-the-server request.GetResponse string result using StreamReader rdr new StreamReader response.GetResponseStream result rdr.ReadToEnd.. rdr new StreamReader response.GetResponseStream result rdr.ReadToEnd return result When I'm running this I'm always getting..
|