.NET

Setting the File DateTime properties

This is pretty much a no brainer for code. However I went and looked and everything I found was either overkill, or i wasn't certain of the internals so i had to say run it, look at the properties etc. So I wrote a simple app to do it and put it on codeplex at: http://setfiledate.codeplex.com/ This problem stemmed from the fact that I got this weird DVD player and I needed it to play some files from a USB stick in a loop. It loops fine, the problem was ordering. No clue how the ordering was. I thought it might be one...

posted @ Thursday, January 13, 2011 10:54 PM | Feedback (0)

set transaction isolation level read only uncommitted in LINQ

apparently you can use a transaction scope for this and just wrap everything that way. but to me that seems more complicated than just enabling it with execute command.   some LINQ code like (note that ‘this’ is a data context): this.ExecuteCommand("set transaction isolation level read uncommitted"); MyTable.Take(5).Dump(); Produces this sql code: set transaction isolation level read uncommitted GO SELECT TOP 5 <fieldnames…> FROM [MyTable] AS [t0] GO   That’s what I want to see, so yay. =)     some links:...

posted @ Friday, August 13, 2010 10:43 AM | Feedback (0)

Adding an task item to sharepoint with C# .net

There are lots of ways to do things like this. Here's a pretty simple way with c# and .net. forgive some of the using shortcuts, i was just isolating a couple of areas. and as always i normally just post these so i don't forget =P this is just a console app to add a single item to a task list in sharepoint. very simple. the only thing that was a bit of a pain is you need to find your sharepoint id for the person. the easiest way i found that for myself was simply to go to the list,...

posted @ Thursday, October 15, 2009 10:38 PM | Feedback (3)

partial trust, permcalc, and caspol, OH MY!

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 ...

posted @ Friday, July 18, 2008 3:54 PM | Feedback (0)

.Net DataReader to ArrayList

string sql = "some sql"ArrayList al = new ArrayList();using (SqlConnection cn = new SqlConnection(cs))using (SqlCommand cmd = new SqlCommand(sql, cn)) {    cn.Open();    using (SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection))    while (dr.Read()) {        object[] o = new object[dr.FieldCount];        dr.GetValues(o);        al.Add(o);    }}foreach(object[] o in al)    Console.WriteLine(a1(o[0].ToString());

posted @ Thursday, December 13, 2007 3:16 PM | Feedback (0)

newsflash .NET > J2EE

I was surfing around today looking for information on .NET vs J2EE performance when I came across this site:http://msdn2.microsoft.com/en-us/netframework/bb499684.aspxSummary from that site:"This application is an end-to-end sample application for .NET Enterprise Application Server technologies. It is a service-oriented application based on Windows Communication Foundation (.NET 3.0) and ASP.NET, and illustrates many of the .NET enterprise development technologies for building highly scalable, rich "enterprise-connected" applications. It is designed as a benchmark kit to illustrate alternative technologies within .NET and their relative performance.The application offers full interoperability with J2EE and IBM WebSphere's Trade 6.1 sample application. As such, the application offers an excellent opportunity for developers to learn about .NET...

posted @ Wednesday, August 15, 2007 9:38 PM | Feedback (2)

404 error or XML Parsing Error: no element found error on IIS with .Net

 A colleague asked me to be a second pair of eyes for a project he was working on that was getting this error. He had just deployed a new .NET web site to a relatively clean IIS6 machine. He was receiving a 404 error in IE when he merely tried to view his asmx pages. When I tried to open them in Firefox, I received an XML Parsing Error: no element found error. After some looking on the web, I didn't find anything that seemed pertinent to our situation. So, I just started looking around. I noticed he had ASP.NET...

posted @ Tuesday, July 31, 2007 12:12 PM | Feedback (0)

More CLR Internal, Debugging, Etc reading material

I'm done with most of these, but not totally. Tons of great information! Here are some more great articles that I found doing debugging research. They mostly pertain to debugging and CLR internals type of stuff. CLR Inside Out - Investigating Memory IssuesDrill Into .NET Framework Internals to See How the CLR Creates Runtime ObjectsSo, what’s new in the CLR 2.0 GC?Windows Debuggers: Part 1: A WinDbg TutorialDebug Tutorial Part 1: Beginning Debugging Using CDB and NTSDDebug Tutorial Part 2: The StackDebug Tutorial Part 3: The HeapDebug Tutorial Part 4: Writing WINDBG ExtensionsDebug Tutorial Part 5: Handle LeaksDebug Tutorial Part 6: Navigating The Kernel DebuggerDebug Tutorial Part 7: Locks and Synchronization ObjectsTraversing the gc heap...

posted @ Wednesday, July 18, 2007 7:55 AM | Feedback (0)

Why "SET NOCOUNT ON" Sucks

As I mentioned in a previous post,  David Hayden sat in the front row and gave me an especially hard time about ‘set nocount on’ as a tip. I don’t remember the exact words, so I’m going to have to roughly paraphrase. His complaint was that some data access layers or object relational mapping tools or other data abstraction methods in .NET sometimes utilized the return record count to determine success or failure. Michael Wells (also in the front row) stated that normally he just utilized a try/catch to determine success, or just relying on a thrown error. Typically, I have taken this approach as well. David was pretty...

posted @ Tuesday, July 17, 2007 6:26 AM | Feedback (1)

simple web service

using System; using System.Data; using System.Data.SqlClient; using System.Web.Services; namespace IamSimple.Service.WebServices {     [WebService(Namespace = "http://royashbrook.com/ns")]     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]     public class simple : System.Web.Services.WebService     {         [WebMethod(Description = "Return a query as a dataset")]         public DataSet QueryAsDataSet(string q)         {             string cs = "connection string"             using (SqlConnection c = new SqlConnection(cs))                 using (SqlCommand cm = new SqlCommand(q, c))                     using (SqlDataAdapter da = new SqlDataAdapter(cm))                         using (DataSet ds = new DataSet())                         {                             ds.RemotingFormat = SerializationFormat.Binary;                             c.Open();                             da.Fill(ds);                             c.Close();                             return ds;                         }     } }

posted @ Wednesday, July 04, 2007 12:50 AM | Feedback (0)

Full .NET Archive