且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows窗体中的datagrid编辑按钮不在Visual Studio 2003中的WEB窗体中

更新时间:2023-12-06 14:26:28

很抱歉让您失望,但无法描述性-我什至没有确保我能给您很多线索或提示.

这样做的原因是我没有VS2003的副本,所以我无法测试我在这里说的任何内容,或者指向您指出:我的PC上甚至都没有VS2005!它太旧了,比当时落后了四个版本和八年,而且很少有人再使用它-他们可能都在进行维护,而不是新项目.
话虽如此,它应该很简单:要更新数据库时,只需在DataAdapter上调用Update方法即可.

MSDN [ ^ ]讨论了Winforms下的DataGrid和DataAdapter-适用于Windows Mobile,其中仍然包括DataGrid,当然包括Mobile 6,甚至可能包含Mobile7.由于Windows Mobile运行的是真实" .NET的NETCE.消除了很多麻烦,只要对WM5起作用的任何东西,只需稍作调整即可在VS2003中使用Winforms.

话虽如此,我强烈建议您升级-至少要升级到VS2008. Microsoft确实将这些工具作为Express版本发布,它们是免费的并且非常完整-当然,对于初学者来说,您不会发现很多遗漏.在这里看看: http://www.microsoft.com/visualstudio/zh-CN /products/2008-editions/express [ ^ ]或此处 [ ^ ] for 2010版本.
Sorry to disappoint you, but it isn''t possible to be descriptive - I''m not even sure if I can give you many clues or hints.

The reason for that is that I do not have a copy of VS2003 so I can''t test anything I say here, or point you to: I don''t even have VS2005 on my PC any more! It''s just too old, four versions and eight years behind the times, and very, very few people are using it any more - and they are probably all doing maintenance, rather than new projects.
Having said that, it should be simple: just call the Update method on your DataAdapter when you want to update the database.

There is a thread on MSDN[^] which discusses DataGrid and DataAdapter under Winforms - it''s for Windows Mobile which still included DataGrid, certainly up to Mobile 6, and possibly in Mobile 7. Since Windows Mobile runs NETCE which is "real" .NET with a lot of the bells and whistles removed anything which works for WM5 should only need minor tweaks to work with Winforms in VS2003.

Having said that, I would strongly suggest that you upgrade - at least as far as VS2008. Microsoft does release these tools as Express versions, which are free and pretty much complete - certainly for a beginner, you won''t notice much missing. Have a look here: http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express[^] or here[^] for the 2010 versions.