Exploring the depths and potentials of ASP.NET RSS 2.0 or Subscribe to .BenRush by Email
 Tuesday, July 10, 2007

Real buggy coding night. I'm in the process of putting together a site for myself when I ran into this problem:

http://forums.microsoft.com/msdn/showpost.aspx?postid=98346&siteid=1

Basically "Failed to generate user instance" and "An attempt to attach...failed".

For "An attempt to attach....failed" I was able to get around this by simply rebooting my development machine. Apparently there is some local cache of files stored on the hard drive that SQL Server Express uses and this was getting out of wack - somehow rebooting the system did the trick for me. It went away, but I was not able to identify exactly what caused the problem; to me this is a bad thing - I really like knowing WHAT happens when something goes wrong.

The "Failed to generate user instance" came from me being remoted into work from home (that'll teach me to work from home). Oh well, I guess I get my site done tomorrow.

Hrmph. :-(


kick it on DotNetKicks.com
Tuesday, July 10, 2007 12:30:35 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
.Net Runtime | ASP.Net | Database | Ranting

We've all been pounded with "beware of SQL Injection Attacks" - yet I found a rather nice blog post here: http://blogs.msdn.com/dglover/archive/2005/06/01/423727.aspx that hands out a nice filter method for SQL Server. You might as well have a look and see if you can introduce it into your stored procedures....


kick it on DotNetKicks.com
Monday, July 09, 2007 11:01:48 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
.Net Runtime | Database | Programming
 Saturday, February 18, 2006

If you want the equivalent of SqlCacheDependency for your oracle databases, look at the OracleDependency class:

static void ListenerStart(System.Object p)
{
Oracle.DataAccess.Client.OracleConnection conn = null;
Oracle.DataAccess.Client.OracleDependency dep = null;
try
{
conn = new Oracle.DataAccess.Client.OracleConnection(connectionString);
conn.Open();
Oracle.DataAccess.Client.OracleCommand comm = conn.CreateCommand();
comm.CommandText = "select * from teset_e";
dep = new Oracle.DataAccess.Client.OracleDependency(comm, false, 50000, false);
dep.OnChange += new Oracle.DataAccess.Client.OnChangeEventHandler(dep_OnChange);
comm.ExecuteNonQuery();
// to prevent the objects from being collected (which I bet they will - I don't
// know for sure), we'll just spin in an idle loop forever.
for (; ; System.Threading.Thread.Sleep(1000)){}
}
catch (System.Threading.ThreadAbortException e)
{
// close the databases
if (conn != null)
conn.Close();
}
return;
}

static void dep_OnChange(object sender, Oracle.DataAccess.Client.OracleNotificationEventArgs eventArgs)
{
changeNoticed = true;
Console.WriteLine("Change noticed at " + System.DateTime.Now.ToString());
return;
}

Recommended reading:

kick it on DotNetKicks.com
Saturday, February 18, 2006 12:08:01 AM (Central Standard Time, UTC-06:00)  #    Comments [1] - Trackback
Computing | Database

Computers Blogs - Blog Top Sites

Archive
<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Benjamin Rush
Sign In
Statistics
Total Posts: 444
This Year: 0
This Month: 0
This Week: 0
Comments: 127
Themes
Pick a theme:
All Content © 2008, Benjamin Rush
DasBlog theme 'Business' created by Christoph De Baene (delarou)