How to drop Linq2SQL class from static class
I have a strange problem, I have a static class like this
public static class BlogDataAccess
{
private static Blog _Blg;
public static Blog Blg
{
get
{
_Blg = new Blog ();
return _Blog ;
}
}
}
then on my page i will do the following
var DataContext= new DataClasses();
BlogDataAccess.Blg.ArticleTitle ="Title";
DataContext.Blog.InsertOnSubmit(BlogDataAccess.Blg);
DataContext.SubmitChanges();
a record is inserted, but with a null value for the ArticleTitle field.
0
a source to share
1 answer