System.InvalidCastException

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
6/21/2005 5:44:01 AM
Gravatar
Total Posts 8

Re: System.InvalidCastException

Have made an update to current version 20050620.

My configuration:

Debian Sarge, Mono from Hoary 1.0.5-2, mono-apache-server 1.0-3, MySQL 4.0.24-10

output:

Description: Error processing request.

Error Message: HTTP 500.

Stack Trace:

System.InvalidCastException: Cannot cast from source type to destination type.
in <0x01726> mojoPortal.Business.SiteSettings:GetSiteSettings (string,int,int)
in <0x00093> mojoPortal.Business.SiteSettings:.ctor (string,int,int)
in <0x002bf> mojoPortal.Web.Global:GetSiteSettings ()
6/21/2005 7:32:30 AM
Gravatar
Total Posts 18439

Re: System.InvalidCastException

What version of mojoPortal were you using before? If it was older than 20050618, then you need to run the update script for each version in between. I'm guessing your mp_Modules table doesn't have the EditUserID column.

I would check for that column and if that doesn't fix it try creating a new db named test and create the tables then compare the table structure column by column to your real db and add any missing columns.
6/21/2005 8:07:34 AM
Gravatar
Total Posts 8

Re: System.InvalidCastException

I have already made a new database for the new Version of mojoPortal! Same problem. I also installed a new Mono Version (1.1.6) from Debian unstable. Didnt work out. The EditUserID column is in the mp_Modules table. Maybe because its compiled under .NET???
6/21/2005 8:45:23 AM
Gravatar
Total Posts 18439

Re: System.InvalidCastException

I don't think its a compilation issue or you would get a different error. To me it looks like a sql or data issue. It is trying to get the site settings which also has the page info for the current page
You are getting the same error with a clean install and an upgrade?
I will try and see if I can replicate the problem tonight after work. I got that exact same error when I first upgraded this site and it was because I was missing the EditUserID column on mp_Modules. If that column is there, make sure it is populated with a 0.

If you have any luck solving it let me know. I'll post again this evening after I test a clean install.
6/21/2005 1:24:43 PM
Gravatar
Total Posts 18439

Re: System.InvalidCastException

I'm not able to reproduce the problem here with a clean install. I install the MS SQL version then replace the mojoPortal.Data.dll with the one from the MySQL data layer. I create a new MySQL db and run the scripts to create tables and create data and it works.

I'm not sure what else to suggest. If you can make it possible for me to connect remotely to your db and have a look I would be glad to try and help diagnose the problem.

joe_audette at yahoo dot com
6/21/2005 11:36:31 PM
Gravatar
Total Posts 8

Re: System.InvalidCastException

I kicked mysql and installed postgresql! Works! I think I am not going to use mysql anymore! But there are still some errors!
When i log in as admin and click the "Admin" nav link i get following error:
Server error in '/' application
Description: Error processing request.

Error Message: HTTP 500.
Stack Trace:

System.ArgumentNullException: Argument cannot be null.
in <0x00043> System.Web.UI.ControlCollection:Add (System.Web.UI.Control)
in <0x002f6> mojoPortal.Web.ChildPageMenu:Page_Load (object,System.EventArgs)
in <0x00069> (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
in <0x0004b> (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
in <0x00067> System.Web.UI.Control:OnLoad (System.EventArgs)
in <0x00031> System.Web.UI.Control:LoadRecursive ()
in <0x000b3> System.Web.UI.Control:LoadRecursive ()
in <0x000b3> System.Web.UI.Control:LoadRecursive ()
in <0x000b3> System.Web.UI.Control:LoadRecursive ()
in <0x000b3> System.Web.UI.Control:LoadRecursive ()
in <0x00198> System.Web.UI.Page:InternalProcessRequest ()
in <0x000c2> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext)
in <0x002eb> ExecuteHandlerState:Execute ()
in <0x00084> StateMachine:ExecuteState (System.Web.HttpApplication/IStateHandler,bool&)



This happens with mysql and postgresql! The eventcalendar doesnt work! message:

Compilation Error
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.

Error message: /tmp/68243.0.cs(198,0) : error CS0117: `mojoPortal.Web.DataCalendar' does not contain a definition for `DataItem' /tmp/68243.0.cs(214,0) : error CS0117: `mojoPortal.Web.DataCalendar' does not contain a definition for `DataItem' /tmp/68243.0.cs(230,0) : error CS0117: `mojoPortal.Web.DataCalendar' does not contain a definition for `DataItem' /tmp/68243.0.cs(262,0) : error CS0117: `mojoPortal.Web.DataCalendar' does not contain a definition for `DataItem' (0,0) : error failed: 4 error(s), 0 warnings

File name: /var/www/mojoportal/Modules/EventCalendar.ascx

Source File: /tmp/68243.0.cs

Line 1: // ------------------------------------------------------------------------------
Line 2: //
Line 3: // This code was generated by a tool.
Line 4: // Mono Runtime Version: 1.1.4322.573
Line 5: //
Line 6: // Changes to this file may cause incorrect behavior and will be lost if
Line 7: // the code is regenerated.
Line 8: //
Line 9: // ------------------------------------------------------------------------------
Line 10:
Line 11: namespace ASP {
Line 12: using System;
Line 13: using System.Collections;
Line 14: using System.Collections.Specialized;
Line 15: using System.Configuration;
Line 16: using System.Text;
Line 17: using System.Text.RegularExpressions;
Line 18: using System.Web;
Line 19: using System.Web.Caching;
Line 20: using System.Web.Security;
Line 21: using System.Web.SessionState;
Line 22: using System.Web.UI;
Line 23: using System.Web.UI.WebControls;
Line 24: using System.Web.UI.HtmlControls;
Line 25: using mojoPortal.Web;
Line 26:
Line 27: public class EventCalendar_ascx : mojoPortal.Web.EventCalendar {
Line 28:
Line 29: private static bool __intialized = false;
Line 30:
Line 31: protected System.Web.UI.WebControls.TableItemStyle _bctrl_99;
Line 32:
Line 33: protected System.Web.UI.WebControls.TableItemStyle _bctrl_100;
Line 34:
Line 35: protected System.Web.UI.WebControls.TableItemStyle _bctrl_101;
Line 36:
Line 37: protected System.Web.UI.WebControls.HyperLink _bctrl_103;
Line 38:
Line 39: protected System.Web.UI.DataBoundLiteralControl _bctrl_104;
Line 40:
Line 41: protected System.Web.UI.DataBoundLiteralControl _bctrl_105;
Line 42:
Line 43: protected System.Web.UI.DataBoundLiteralControl _bctrl_106;
Line 44:
Line 45: protected System.Web.UI.DataBoundLiteralControl _bctrl_107;
Line 46:
Line 47: public EventCalendar_ascx () {
Line 48: if ((ASP.EventCalendar_ascx.__intialized == false)) {
Line 49: ASP.EventCalendar_ascx.__intialized = true;
Line 50: }
Line 51: }
Line 52:
Line 53: protected override bool SupportAutoEvents {
Line 54: get {
Line 55: return false;
Line 56: }
Line 57: }
Line 58:
Line 59: protected System.Web.HttpApplication ApplicationInstance {
Line 60: get {
Line 61: return ((System.Web.HttpApplication)(this.Context.ApplicationInstance));
Line 62: }
Line 63: }
Line 64:
Line 65: public override string TemplateSourceDirectory {
Line 66: get {
Line 67: return "/Modules";
Line 68: }
Line 69: }
Line 70:
Line 71: private void __BuildControlTree(System.Web.UI.Control __ctrl) {
Line 72: this.__BuildControl_Title1();
Line 73: System.Web.UI.IParserAccessor __parser = ((System.Web.UI.IParserAccessor)(__ctrl));
Line 74: __parser.AddParsedSubObject(this.Title1);
Line 75: __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\n"));
Line 76: this.__BuildControl_cal1();
Line 77: __parser.AddParsedSubObject(this.cal1);
Line 78: __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\n"));
Line 79: }
Line 80:
Line 81: private System.Web.UI.Control __BuildControl_Title1() {
Line 82: ASP.ModuleTitle_ascx __ctrl;
Line 83: __ctrl = new ASP.ModuleTitle_ascx();
Line 84: this.Title1 = __ctrl;
Line 85: this.Title1.InitializeAsUserControl(this.Page);
Line 86: __ctrl.EditText = "Add Link";
Line 87: __ctrl.ID = "Title1";
Line 88: __ctrl.EditUrl = "/LinksEdit.aspx";
Line 89: return __ctrl;
Line 90: }
Line 91:
Line 92: private System.Web.UI.Control __BuildControl_cal1() {
Line 93: mojoPortal.Web.DataCalendar __ctrl;
Line 94: __ctrl = new mojoPortal.Web.DataCalendar();
Line 95: this.cal1 = __ctrl;
Line 96: __ctrl.WeekendDayStyle.CssClass = "EventCalendarWeekendDay";
Line 97: __ctrl.CellPadding = 0;
Line 98: __ctrl.TitleStyle.BorderWidth = ((System.Web.UI.WebControls.Unit)(System.ComponentModel.TypeDescriptor.GetConverter(typeof(System.Web.UI.WebControls.Unit)).ConvertFrom("0")));
Line 99: __ctrl.DayField = "EventDate";
Line 100: __ctrl.SelectorStyle.BorderWidth = ((System.Web.UI.WebControls.Unit)(System.ComponentModel.TypeDescriptor.GetConverter(typeof(System.Web.UI.WebControls.Unit)).ConvertFrom("0")));
Line 101: __ctrl.NextPrevStyle.CssClass = "EventCalendarNextPrev";
Line 102: __ctrl.DayHeaderStyle.CssClass = "EventCalendarDayHeader";
Line 103: __ctrl.BorderWidth = ((System.Web.UI.WebControls.Unit)(System.ComponentModel.TypeDescriptor.GetConverter(typeof(System.Web.UI.WebControls.Unit)).ConvertFrom("1")));
Line 104: __ctrl.Width = ((System.Web.UI.WebControls.Unit)(System.ComponentModel.TypeDescriptor.GetConverter(typeof(System.Web.UI.WebControls.Unit)).ConvertFrom("100%")));
Line 105: __ctrl.NextPrevStyle.ForeColor = System.Drawing.Color.White;
Line 106: __ctrl.DayStyle.CssClass = "EventCalendarDay";
Line 107: __ctrl.SelectionMode = System.Web.UI.WebControls.CalendarSelectionMode.Day;
Line 108: __ctrl.ID = "cal1";
Line 109: __ctrl.ShowGridLines = true;
Line 110: __ctrl.TitleStyle.CssClass = "EventCalendarTitle";
Line 111: __ctrl.BorderColor = System.Drawing.Color.Black;
Line 112: __ctrl.BorderStyle = System.Web.UI.WebControls.BorderStyle.None;
Line 113: __ctrl.Font.Name = "Tahoma";
Line 114: this.__BuildControl__bctrl_99(__ctrl.DayWithEventsStyle);
Line 115: this.__BuildControl__bctrl_100(__ctrl.CurrentDayStyle);
Line 116: this.__BuildControl__bctrl_101(__ctrl.OtherMonthDayStyle);
Line 117: __ctrl.ItemTemplate = new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.__BuildControl__bctrl_102));
Line 118: __ctrl.NoEventsTemplate = new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.__BuildControl__bctrl_108));
Line 119: return __ctrl;
Line 120: }
Line 121:
Line 122: private void __BuildControl__bctrl_99(System.Web.UI.WebControls.TableItemStyle __ctrl) {
Line 123: __ctrl.Font.Bold = true;
Line 124: __ctrl.ForeColor = System.Drawing.Color.Black;
Line 125: }
Line 126:
Line 127: private void __BuildControl__bctrl_100(System.Web.UI.WebControls.TableItemStyle __ctrl) {
Line 128: __ctrl.Font.Bold = true;
Line 129: __ctrl.BackColor = System.Drawing.Color.WhiteSmoke;
Line 130: __ctrl.ForeColor = System.Drawing.Color.DarkGray;
Line 131: }
Line 132:
Line 133: private void __BuildControl__bctrl_101(System.Web.UI.WebControls.TableItemStyle __ctrl) {
Line 134: __ctrl.BackColor = System.Drawing.Color.LightGray;
Line 135: __ctrl.ForeColor = System.Drawing.Color.DarkGray;
Line 136: }
Line 137:
Line 138: private void __BuildControl__bctrl_102(System.Web.UI.Control __ctrl) {
Line 139: System.Web.UI.IParserAccessor __parser = ((System.Web.UI.IParserAccessor)(__ctrl));
Line 140: __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\n\t\t
\n\t\t
\n\t\t"));
Line 141: this.__BuildControl__bctrl_103();
Line 142: __parser.AddParsedSubObject(this._bctrl_103);
Line 143: __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\n\t\t\n\t\t"));
Line 152: this.__BuildControl__bctrl_107();
Line 153: __parser.AddParsedSubObject(this._bctrl_107);
Line 154: __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\n\t\t
\n\t\t\n\t"));
Line 155: }
Line 156:
Line 157: private System.Web.UI.Control __BuildControl__bctrl_103() {
Line 158: System.Web.UI.WebControls.HyperLink __ctrl;
Line 159: __ctrl = new System.Web.UI.WebControls.HyperLink();
Line 160: this._bctrl_103 = __ctrl;
Line 161: __ctrl.ID = "editLink";
Line 162: __ctrl.DataBinding += new System.EventHandler(this.__BuildControl__bctrl_103_DB_0);
Line 163: __ctrl.DataBinding += new System.EventHandler(this.__BuildControl__bctrl_103_DB_1);
Line 164: __ctrl.DataBinding += new System.EventHandler(this.__BuildControl__bctrl_103_DB_2);
Line 165: __ctrl.DataBinding += new System.EventHandler(this.__BuildControl__bctrl_103_DB_3);
Line 166: return __ctrl;
Line 167: }
Line 168:
Line 169: public void __BuildControl__bctrl_103_DB_0(object sender, System.EventArgs e) {
Line 170: mojoPortal.Web.DataCalendar Container;
Line 171: System.Web.UI.WebControls.HyperLink target;
Line 172: target = ((System.Web.UI.WebControls.HyperLink)(sender));
Line 173: Container = ((mojoPortal.Web.DataCalendar)(target.BindingContainer));
Line 174: target.Text = System.Convert.ToString( EditAltText);
Line 175: }
Line 176:
Line 177: public void __BuildControl__bctrl_103_DB_1(object sender, System.EventArgs e) {
Line 178: mojoPortal.Web.DataCalendar Container;
Line 179: System.Web.UI.WebControls.HyperLink target;
Line 180: target = ((System.Web.UI.WebControls.HyperLink)(sender));
Line 181: Container = ((mojoPortal.Web.DataCalendar)(target.BindingContainer));
Line 182: target.ImageUrl = System.Convert.ToString( this.SiteRoot + "/Data/SiteImages/" + EditContentImage );
Line 183: }
Line 184:
Line 185: public void __BuildControl__bctrl_103_DB_2(object sender, System.EventArgs e) {
Line 186: mojoPortal.Web.DataCalendar Container;
Line 187: System.Web.UI.WebControls.HyperLink target;
Line 188: target = ((System.Web.UI.WebControls.HyperLink)(sender));
Line 189: Container = ((mojoPortal.Web.DataCalendar)(target.BindingContainer));
Line 190: target.Visible = ((bool)( IsEditable ));
Line 191: }
Line 192:
Line 193: public void __BuildControl__bctrl_103_DB_3(object sender, System.EventArgs e) {
Line 194: mojoPortal.Web.DataCalendar Container;
Line 195: System.Web.UI.WebControls.HyperLink target;
Line 196: target = ((System.Web.UI.WebControls.HyperLink)(sender));
Line 197: Container = ((mojoPortal.Web.DataCalendar)(target.BindingContainer));
Line 198: target.NavigateUrl = System.Convert.ToString( this.SiteRoot + "/EventCalendarEdit.aspx?pageid=" + PageID.ToString() + "&ItemID=" + Container.DataItem["ItemID"] + "&mid=" + ModuleID + "&pageindex=" + Request.Params.Get("pageindex") );
Line 199: }
Line 200:
Line 201: private System.Web.UI.Control __BuildControl__bctrl_104() {
Line 202: System.Web.UI.DataBoundLiteralControl __ctrl;
Line 203: __ctrl = new System.Web.UI.DataBoundLiteralControl(0, 1);
Line 204: this._bctrl_104 = __ctrl;
Line 205: __ctrl.DataBinding += new System.EventHandler(this.__DataBind__bctrl_104);
Line 206: return __ctrl;
Line 207: }
Line 208:
Line 209: public void __DataBind__bctrl_104(object sender, System.EventArgs e) {
Line 210: mojoPortal.Web.DataCalendar Container;
Line 211: System.Web.UI.DataBoundLiteralControl target;
Line 212: target = ((System.Web.UI.DataBoundLiteralControl)(sender));
Line 213: Container = ((mojoPortal.Web.DataCalendar)(target.BindingContainer));
Line 214: target.SetDataBoundString(0, System.Convert.ToString( Container.DataItem["ItemID"] ));
Line 215: }
Line 216:
Line 217: private System.Web.UI.Control __BuildControl__bctrl_105() {
Line 218: System.Web.UI.DataBoundLiteralControl __ctrl;
Line 219: __ctrl = new System.Web.UI.DataBoundLiteralControl(0, 1);
Line 220: this._bctrl_105 = __ctrl;
Line 221: __ctrl.DataBinding += new System.EventHandler(this.__DataBind__bctrl_105);
Line 222: return __ctrl;
Line 223: }
Line 224:
Line 225: public void __DataBind__bctrl_105(object sender, System.EventArgs e) {
Line 226: mojoPortal.Web.DataCalendar Container;
Line 227: System.Web.UI.DataBoundLiteralControl target;
Line 228: target = ((System.Web.UI.DataBoundLiteralControl)(sender));
Line 229: Container = ((mojoPortal.Web.DataCalendar)(target.BindingContainer));
Line 230: target.SetDataBoundString(0, System.Convert.ToString( Container.DataItem["ModuleID"] ));
Line 231: }
Line 232:
Line 233: private System.Web.UI.Control __BuildControl__bctrl_106() {
Line 234: System.Web.UI.DataBoundLiteralControl __ctrl;
Line 235: __ctrl = new System.Web.UI.DataBoundLiteralControl(0, 1);
Line 236: this._bctrl_106 = __ctrl;
Line 237: __ctrl.DataBinding += new System.EventHandler(this.__DataBind__bctrl_106);
Line 238: return __ctrl;
Line 239: }
Line 240:
Line 241: public void __DataBind__bctrl_106(object sender, System.EventArgs e) {
Line 242: mojoPortal.Web.DataCalendar Container;
Line 243: System.Web.UI.DataBoundLiteralControl target;
Line 244: target = ((System.Web.UI.DataBoundLiteralControl)(sender));
Line 245: Container = ((mojoPortal.Web.DataCalendar)(target.BindingContainer));
Line 246: target.SetDataBoundString(0, System.Convert.ToString( "&pageindex=" + Request.Params.Get("pageindex") ));
Line 247: }
Line 248:
Line 249: private System.Web.UI.Control __BuildControl__bctrl_107() {
Line 250: System.Web.UI.DataBoundLiteralControl __ctrl;
Line 251: __ctrl = new System.Web.UI.DataBoundLiteralControl(0, 1);
Line 252: this._bctrl_107 = __ctrl;
Line 253: __ctrl.DataBinding += new System.EventHandler(this.__DataBind__bctrl_107);
Line 254: return __ctrl;
Line 255: }
Line 256:
Line 257: public void __DataBind__bctrl_107(object sender, System.EventArgs e) {
Line 258: mojoPortal.Web.DataCalendar Container;
Line 259: System.Web.UI.DataBoundLiteralControl target;
Line 260: target = ((System.Web.UI.DataBoundLiteralControl)(sender));
Line 261: Container = ((mojoPortal.Web.DataCalendar)(target.BindingContainer));
Line 262: target.SetDataBoundString(0, System.Convert.ToString( Container.DataItem["Title"] ));
Line 263: }
Line 264:
Line 265: private void __BuildControl__bctrl_108(System.Web.UI.Control __ctrl) {
Line 266: System.Web.UI.IParserAccessor __parser = ((System.Web.UI.IParserAccessor)(__ctrl));
Line 267: __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t"));
Line 268: }
Line 269:
Line 270: protected override void FrameworkInitialize() {
Line 271: this.__BuildControlTree(this);
Line 272: }
Line 273: }
Line 274:
Line 275: }

6/22/2005 2:28:55 AM
Gravatar
Total Posts 18439

Re: System.InvalidCastException

The error about the Event Calendar is because of a bug in mono that was fixed as of 1.1.7. I have previously mentioned this in other posts in this forum.

I also have seen the error about the Admin page link. It seems to be a problem with my ChildPageManu.ascx control. I get the same error on this site but on a box at home with newer mono I get no error.
You can get rid of the error by turning off the "Show Child Page Menu" feature for the Admin page. Go into the Add/Edit Pages, click the Admin page then click the gear icon to get to the settings.
I will look into finding a workaround for this one. For the Calendar there is nothing I can do, you need at least v1.1.7 of mono.

Hope it helps.
6/22/2005 10:08:23 AM
Gravatar
Total Posts 49
Juliano Morais Barbosa

Re: System.InvalidCastException

Server error in '/' application
Description: Error processing request.

Error Message: HTTP 500.
Stack Trace:

System.InvalidCastException: Cannot cast from source type to destination type.
in <0x013d9> mojoPortal.Business.SiteSettings:GetSiteSettings (System.String HostName, Int32 PageIndex, Int32 PageID)
in <0x00076> mojoPortal.Business.SiteSettings:.ctor (System.String HostName, Int32 PageIndex, Int32 PageID)
in <0x0022e> mojoPortal.Web.Global:GetSiteSettings ()

My Machine:
mono 1.1.8.1
apache 1.3
mojoportal: 20050620mojoportal-PostgreSQLBinaries.zip
6/22/2005 12:04:50 PM
Gravatar
Total Posts 18439

Re: System.InvalidCastException

Juliano,

Does your mp_modules table have the edituserid column?
If not can you add that column as an int with a default of 0 and see if that fixes it.

Also did you re-run the script to create the stored procedures?

Joe

6/22/2005 2:22:34 PM
Gravatar
Total Posts 18439

Re: System.InvalidCastException

The only thing new in SiteSettings is this line

m.EditUserID = (int) result["EditUserID"];

where result is an IDataReader

That has to be where the invalid cast is coming from so I really think either the column is missing or it is populated with null. It needs to be 0 instead of null and 0 should be the default.

I really look forward to the day when I can step through the code on mono as that will make it much easier to troubleshoot issues like this.

I am going to be adding logging so that will help some.

If that doesn't solve it for you let me know.
If you'd like I can wrap a try catch block around that line of code and send you a new mojoPortal.Web.dll to try

In looking at my Postgre upgrade script from 20050501to20050530 I see the line where I added that column
ALTER TABLE mp_modules ADD COLUMN edituserid integer;
I did not make it default to 0 like in the clean install script so that is most likely the problem.

You should enter 0 in the existing rows and set it to NOT NULL with default of 0

BEGIN;

UPDATE mp_modules SET edituserid = 0;
ALTER TABLE mp_modules ALTER COLUMN edituserid SET DEFAULT 0;
ALTER TABLE mp_modules ALTER COLUMN edituserid SET NOT NULL;


COMMIT;
6/22/2005 3:29:05 PM
Gravatar
Total Posts 49
Juliano Morais Barbosa

Re: System.InvalidCastException

works fine.

T H A N X X X X X XX X X X X X X X X
You must sign in to post in the forums. This thread is closed to new posts.