表到结构变量 [英] table to structered variable

查看:95
本文介绍了表到结构变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

i have an structere variable<br />
<br />
Structure Settings<br />
        Dim SqlIp As String<br />
        Dim SqlName As String<br />
        Dim SqlDataBase As String<br />
        Dim SqlUser As String<br />
        Dim SqlPass As String<br />
End Structure<br />
<br />
and i have a table on SqlCe, <br />
<br />
Table Name= SETTINGS<br />
ID       SettingsName           Value<br />
1        SqlIp                  127.0.0.1<br />
2        SqlName                local<br />
3        SqldataBase            NortWind<br />
4        SqlUser                sa<br />
5        SqlPass                1234<br />
   <br />
how may i set this structered variables with the data on table at win.ce mobile device with vb.net

推荐答案

您从数据库中加载数据,然后读取每一行,并编写代码以将该数据加载到结构实例中.如果您有某种ORM,则可以创建映射,但是VB本身不提供将结构映射到表的任何自动方法.
You load the data from your database, then you read each row, and write code to load that data into instances of your structure. If you have some sort of ORM you can create a mapping, but VB itself doesn''t give you any sort of automagic way to map a struct to a table.


是否可以对设置结构化变量
使用诸如"for each ....."之类的循环 还是可以使用诸如my.settings和propertygrid之类的方法在移动设备开发时保存用户设置.
我之前用setup.ini文件制作过,但是很痛苦
is it possible to use a loop like "for each ....." for the setting structered variable
or is there a way like my.settings and propertygrid for saving the user settings at mobile device developing.
i made it with a setup.ini file before that but it was so painful


这篇关于表到结构变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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