Unable to cast object of type 'System.DBNull' to type 'System.String'.

Hi there,

If I add a new event and leave the description field empty the StarterKit seems to throw a big wobbly over the null values in my DB (SQL2000).

Have I made a mistake in the installation or something?

0
t0ny
7/25/2006 7:26:33 PM
asp.net.club-site-starter-kit 1219 articles. 0 followers. Follow

3 Replies
874 Views

Similar Articles

[PageSpeed] 46

The problem lies in this line:

SharedRoutines.truncate((string)Eval("description")) because description is Null.

I want to sort this in this line and I don't want to reply on validators?

0
t0ny
7/25/2006 8:19:10 PM
This is a known issue reported in the Identified Bugs and Fixes for the ClubSite Starter Kit post. I don't think there is one definitive answer. Search on your error message and you'll find several thoughts on how to fix it.
0
mikedeko
7/25/2006 11:26:16 PM

Mikedeko is correct.Smile

On his suggested thread, specifically look for Bug#5

Of course it's not the only solution, but nevertheless....


"Our truest life is when we are in dreams awake." - Henry David Thoreau
0
BugSlayer
7/26/2006 3:38:13 PM
Reply:

Similar Artilces:

System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'
Hello , I am a data table with null able Columns.I am not able to catch the value for DBNull. I did set a value to be returned as empty in dataset. Here is the code where i am trying to catch.1 public List GetStores() 2 { 3 List tmpStore = new List(); 4 StoresService.shopDBDataSet.StoresDataTable stores = 5 storesService.GetStores(); 6 for (int i = 0; i < stores.Count ; i++) 7 { 8 Store store = new Store(); 9 store.StoreID = stores[i].StoreID...

Unable to cast object of type 'System.DBNull' to type 'System.String'
I have received the following error when I am logged in as administrator.  I wanted to test the load event feature.  Allows me to load and save new event.  I can view event on location view page but when I try to link to "list or calender" view I receive this error "Unable to cast object of type 'System.DBNull' to type 'System.String'.  Debug highlights the <asp:HyperlinkID as errored line. Any assistance would be greatly appreciated Brian   <DayEventTemplate> <div style="padding: 3px;"> <asp:Hyper...

Unable to cast object of type 'System.DBNull' to type 'System.String'. #2
I am getting this error when I try to run the code below. The error is happening on the last for each loop || foreach (string s in dr.ItemArray) || Please see below:        private void button1_Click(object sender, EventArgs e)        {            string myOutput = "";            DataTable dt = new DataTable();            using (TextReader tr = File.O...

Unable to cast object of type 'System.DBNull' to type 'System.String'. #2
 Hi:I am totally new to asp.net and downloaded the club website project. I have not done anything to the events page yet but as soon as i tried to add an event I got the following error. "Unable to cast object of type 'System.DBNull' to type 'System.String'." Can someone help me out here?ThanksBrian  This bug has been covered in the Identified Bugs and fixes section.  http://forums.asp.net/t/970081.aspx There are a few solutions and discussions on fixes, you will need to read through it to find the fix. Support@aspsksolutions.com Without kno...

Eventcalender: Unable to cast object of type 'System.DBNull' to type 'System.String'.
 I added an event in the eventcalender. When I try to view the events_calender.aspx I get this error message, what can be wrong??   Server Error in '/bfc_csk' Application. Unable to cast object of type 'System.DBNull' to type 'System.String'. 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.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.Source Err...

System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Byte[]'.
Hi All, I am trying to retrieve a Picture from an SQL 2005 database. Here is my code:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ListingID As String = (Request.QueryString("GUID")) 'Connect to the database and bring back the image contents & MIME type for the specified pictureUsing myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionStringListings").ConnectionString) Const SQL As String = "SELECT [Pic1Ext], [Picture1] FROM [Listings] WHERE [ListingID] = @ListingID"C...

"Unable to cast object of type 'System.String' to type 'System.String[]'."
hi i'm using the following statement in my applicationstring[] strTArray = new string[5]; strTArray = (string[])(Session["TextDataArray"]); when i run the application its giving the below error {"Unable to cast object of type 'System.String' to type 'System.String[]'."} can anyone say how to solve this thanks in advance Archu What are you storing in the TextDataArray session? What is the data type you are storing?   RegardsBilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP...

Unable to cast object of type '<>f__AnonymousType1`3[System.Guid,System.String,System.String]' to type 'aspnet_User'.???
Hi everyone, What does this error mean?  ERROR: Unable to cast object of type '<>f__AnonymousType1`3[System.Guid,System.String,System.String]' to type 'aspnet_User'. Thank's a lot /PepePepe JoseNewbie@C#.Net&jRuby What type is in your DataItem?  A Guid? or a String?  Either way, it's telling you cant cast it to a aspnet_User type.  Let us know what your DataItem is and we can help further.Good Luck and happy programming!Let's build community! If my post helped you, mark it as the Answer and I will do the same when you help me.....

How do I get around this error "Unable to cast object of type 'System.DBNull' to type 'System.String' "
I am using Visual Developer 2008 Express Edition for the first time, and I keep getting the following error below. The site allows anyone to enter with a valid username and password, but even when I logoff the site I get the same error....like the memory or database is not getting refreshed. I would think that when I initially compile the site that anything left in memory would be flushed out. Can someone please help me to figure this out. Thanks,Ramell P.S. The site is programmed using C#    Unable to cast object of type 'System.DBNull' to type 'System.String&...

Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.
Hi, I have developed a custom server control for .NET Framework 2.0. The server control has a property named BinaryData of type byte[]. I marked this property to be data bindable. Now, I have varbinary(Max) type of field in my SQL Database and I have used SQLDataSource and bound this varbinary(Max) field with the property BinaryData (byte[]) of my control. It is working fine as long as the data value is not NULL. Now, In my control, I have handled the NULL value so that no Exception is thrown. Still, when I bind this property using the SQLDataSource, I get Error "Unable to cast object ...

Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.
I'm getting Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'. anyone knows how to write some code to check if my binary data is null then continue check another data? I've tried but seems that byte and string can't convert...  (hope someone can provide me code in VB and where to insert them :))  Here's my code:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ID As Integer = Convert.ToInt32(Request.QueryString("ID"))Using myConnection As New SqlConnection(Configuratio...

Web resources about - Unable to cast object of type 'System.DBNull' to type 'System.String'. - asp.net.club-site-starter-kit

Resources last updated: 11/21/2015 10:33:51 PM