.NET
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...
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:...
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,...
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
MicrosoftInternetExplorer4
...
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());
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...
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...
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...
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...
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;
}
}
}
Full .NET Archive