WinForms上Datagridview中的数据绑定 [英] Databinding in Datagridview on winforms

查看:51
本文介绍了WinForms上Datagridview中的数据绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在Windows窗体应用程序的Datagridview中绑定数据时,
它显示以下错误.

从数据库检索信息时发生错误

无法比较数组中的两个元素"

错误会是什么?

我也是winforms的新手.

在此先感谢.

[从OP的答复移至-亨利]
抱歉,回复晚了,这是我的配置文件,

Hi all,

While I bound data in the Datagridview in the Windows form application,
It shows the below error.

"An Error occurred while retrieving the information from the database

Failed to compare two elements in the Array"

What will be the error?

Also I am new to winforms.

Thanks in Advance.

[Moved from Answer by OP - Henry]
Sorry for the late reply, This is my config file,

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="TAS_DEVICE_CONTROLLER.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <connectionStrings>
    <add name="Visa_Medical.Properties.Settings.ConnectionString"

      connectionString="Data Source=XE;User ID=WITS_TAS;Password=WITS_TAS;Unicode=True;user_name=wits;password=wits;"

      providerName="System.Data.OracleClient" />
    <add name="TAS_DEVICE_CONTROLLER.Properties.Settings.ConnectionString"

      connectionString="Data Source=XE;User ID=WITS_TAS;Password=WITS_TAS;Unicode=True"

      providerName="System.Data.OracleClient" />
  </connectionStrings>
  <appSettings>
    <add key="loginRequired" value="NO" />
    <add key="user_name" value="wits" />
    <add key="password" value="3RvaULhfDQE2dsDf7t6BHQ==" />
    <add key="db_data_source" value="XE" />
    <add key="db_user_name" value="WITS_TAS" />
    <add key="db_password" value="F0/A8RH3CLvbzaeuxfwphX8ulDmpk5Bu8q1WAdSoZxg=" />
    <add key="ClientSettingsProvider.ServiceUri" value="" />
    <add key="ConnectionString" value="Data Source=XE;Integrated Security=false;User ID=WITS_TAS;Password=WITS_TAS;Unicode=True"/>
  </appSettings>
  <system.web>
    <membership defaultProvider="ClientAuthenticationMembershipProvider">
      <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
      </providers>
    </membership>
    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
      <providers>
        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
      </providers>
      <providers>
        <add name="System.Data.OracleClient" type="System.Data.OracleClient" />
      </providers>
    </roleManager>
  </system.web>
  <applicationSettings>
    <TAS_DEVICE_CONTROLLER.Properties.Settings>
      <setting name="Setting" serializeAs="String">
        <value />
      </setting>
      <setting name="Setting1" serializeAs="String">
        <value />
      </setting>
    </TAS_DEVICE_CONTROLLER.Properties.Settings>
  </applicationSettings>
</configuration>



请让我知道我是否编码有误?


[/Moved]



Please let me know if I have done any wrong coding?


[/Moved]

推荐答案

看起来像您要比较的两个值不具有可比性.
在此处发布更多代码可能会有所帮助.
Looks like two values that you are trying to compare are not comparable.
Posting some more code here may help.


这篇关于WinForms上Datagridview中的数据绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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