1
Answer

Bug in this web site's code

Photo of ksfok

ksfok

20y
2.5k
1
Please fix a bug I saw when trying to post a reply here: Server Error in '/Forums/AspNetForums20' Application. -------------------------------------------------------------------------------- Cannot insert the value NULL into column 'PinnedDate', table 'V003U27DHH.dbo.Posts'; column does not allow nulls. INSERT fails. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Exception: Cannot insert the value NULL into column 'PinnedDate', table 'V003U27DHH.dbo.Posts'; column does not allow nulls. INSERT fails. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [Exception: Cannot insert the value NULL into column 'PinnedDate', table 'V003U27DHH.dbo.Posts'; column does not allow nulls. INSERT fails.] AspNetForums.Data.SqlDataProvider.AddPost(Post postToAdd, String username) AspNetForums.Posts.AddPost(Post postToAdd) AspNetForums.Controls.CreateEditPost.PostButton_Click(Object sender, EventArgs e) System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1277 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Answers (1)

0
Photo of kovan
NA 636 0 21y
have a preference section in your application where the user can select the database file themselves (network or local) just use the OpenFileDialog to give the user browsing ability to locat the database then save this path in a xml file or registry or INI (prefered way is a .config or xml file..
0
Photo of Adam Erstelle
NA 343 0 21y
I am using the ODBC .Net provider for accessing the database. I am in a similar situation, and have generated my Connection string based on a value that I set somewhere (can be hard coded or in a .ini file, or in the registry) With ODBC, you can set the DSN name to be almost anywhere. I am limited because I use an Access Database, so I have to have a network drive mapped in order for the database to be available. Hope this helps Wiggum
Next Recommended Forum