以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  使用外部数据表存储用户信息出现错误  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=87664)

--  作者:mayazql
--  发布时间:2016/7/16 14:33:00
--  使用外部数据表存储用户信息出现错误
我将用户信息存在sql server的表users中,Name已经设置为主键,出现下面的错误

有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。

************** 异常文本 **************
System.InvalidCastException: 从类型“DBNull”到类型“Integer”的转换无效。
   在 Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(Object Value)
   在 Foxtable.O__0__o0.o0o 00  (Object A_0, EventArgs A_1)
   在 System.Windows.Forms.Form.OnLoad(EventArgs e)
   在 System.Windows.Forms.Form.OnCreateControl()
   在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   在 System.Windows.Forms.Control.CreateControl()
   在 System.Windows.Forms.Control.WmShowWindow(Message& m)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
   在 System.Windows.Forms.Form.WmShowWindow(Message& m)
   在 System.Windows.Forms.Form.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



--  作者:Hyphen
--  发布时间:2016/7/16 14:52:00
--  
自己管理用户的还是用内置的用户管理。

afteropenproject事件或者登录窗口afterload事件代码贴出来

--  作者:mayazql
--  发布时间:2016/7/16 15:33:00
--  
还没有写代码,只是刚把用户管理放到外部数据源,定义组的时候就报错
--  作者:Hyphen
--  发布时间:2016/7/16 16:29:00
--  
测试没有问题。http://www.foxtable.com/webhelp/scr/2723.htm

确认表结构是否定义正确

--  作者:mayazql
--  发布时间:2016/7/16 16:51:00
--  
有问题的这个是用的win10 + SQL SERVER 2016 开发版,我在虚拟机重新装了win7 + sql server 2005, 就一切正常了。
不知道原因。

--  作者:狐狸爸爸
--  发布时间:2016/7/18 7:56:00
--  
 应该是某行的有Type列没有输入内容