使用字符串输出来设置标识符

时间:2016-02-02 03:31:13

标签: vb.net model-view-controller sqldatareader sqlconnection

Installing egg-scripts.
uses namespace packages but the distribution does not require setuptools.
Getting distribution for 'cryptography==0.2.1'.

no previously-included directories found matching 'documentation/_build'
zip_safe flag not set; analyzing archive contents...
six: module references __path__

Installed /tmp/easy_install-oUz7ei/cryptography-0.2.1/.eggs/six-1.10.0-py2.7.egg
Searching for cffi>=0.8
Reading https://pypi.python.org/simple/cffi/
Best match: cffi 1.5.0
Downloading https://pypi.python.org/packages/source/c/cffi/cffi-1.5.0.tar.gz#md5=dec8441e67880494ee881305059af656
Processing cffi-1.5.0.tar.gz
Writing /tmp/easy_install-oUz7ei/cryptography-0.2.1/temp/easy_install-Yf2Yl3/cffi-1.5.0/setup.cfg
Running cffi-1.5.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-oUz7ei/cryptography-0.2.1/temp/easy_install-Yf2Yl3/cffi-1.5.0/egg-dist-tmp-A2kjMD
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
 #include <ffi.h>
                 ^
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
An error occurred when trying to install cryptography 0.2.1. Look above this message for any errors that were output by easy_install.
While:
  Installing egg-scripts.
  Getting distribution for 'cryptography==0.2.1'.
Error: Couldn't install: cryptography 0.2.1

我没有输入和声明变量并逐个分配lrd(...),而是创建了一个循环函数来分配,但是还有一件事是使用name.Names的输出来声明lsData,任何想法我怎么能解决这个问题,我试着解决这个问题已经过了5个小时并一遍又一遍地摸不着头,直到出血,或者是否还有其他任何方式/方法来循环这个而没有声明和分配lrd(... 。)非常感谢你们。

1 个答案:

答案 0 :(得分:0)

一旦开始使用Reflection,就必须继续这样做。您无法将包含名称的String神奇地转换为标识符。您可以使用PropertyInfo对象通过调用其SetValue方法来设置对象的属性值,例如

myPropertyInfo.SetValue(targetObject, value)

这相当于:

targetObject.MyProperty = value