选择一行并将其投射到一个对象中 [英] select a row and cast it into an object

查看:83
本文介绍了选择一行并将其投射到一个对象中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好开发人员正在使用数据网格视图在紧凑的

框架中开发一个应用程序,但我没有选择

a行并将其转换为一个对象,以便我可以执行

对它的操作。



谢谢

Hello developers am developing an application in compact
framework using a datagrid view but am failing to select
a row and cast it into an object such that i can perform
operations on it.

Thanks

推荐答案

你必须选择行中的值,然后构造您的对象。从数据行到我知道的任何对象都没有强制转换,当然也没有基于行中数据的类。
You have to select the values out of the row, then construct your object. There''s no cast from a data row to any object that I know of, certainly not to a class based on the data in the row.


正如Christian所说,那是'不是一个自动过程。您应该实现所谓的对象序列化。看看这个页面:序列化(C#和Visual Basic) [< a href =http://msdn.microsoft.com/en-us/library/vstudio/ms233843.aspxtarget =_ blanktitle =New Window> ^ ]。
As Christian stated, that''s not an automatic process. You should implement what is called ''object serialization''. Have a look at this page: "Serialization (C# and Visual Basic)"[^].


这篇关于选择一行并将其投射到一个对象中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆