.net - Excel阿拉伯语列查询.Net
问题描述
我在列中有带有阿拉伯文本的 Excel 表,当我想在 vb.net 中检索数据时,总是遇到问题:
没有为一个或多个必需参数提供值
代码是这样的:
Dim Dta1 As OleDbCommand
Dim Dta1 As OleDbCommand
Using conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Excel + ";Extended Properties=Excel 12.0;")
conn.Open()
Dta2 = New OleDbCommand("Select Count([إسم الثلاثي للمريض]) From [Sheet1$A:S] GROUP BY Name HAVING COUNT(*) > 1", conn)
Dta3 = New OleDbCommand("Select Count([رقم الهاتف]) From [Sheet1$] GROUP BY Phone HAVING COUNT(*) > 1", conn)
Dim b As Integer = Dta2.ExecuteScalar
Dim c As Integer = Dta3.ExecuteScalar
End Using
代码停在 Dta2.ExecuteScalar
解决方案
使用前定义所有变量
dim st1 as String ="إسم الثلاثي للمريض"
dim st2 as String ="رقم الهاتف"
Dta2 = New OleDbCommand("Select Count(st1) From [Sheet1$A:S] GROUP BY Name HAVING COUNT(*) > 1", conn)
Dta3 = New OleDbCommand("Select Count(st2 ) From [Sheet1$] GROUP BY Phone HAVING COUNT(*) > 1", conn)
推荐阅读
- php - 如何动态加载类列表?
- javascript - Ng-Select Selected 未从 ngModel 更新
- amazon-web-services - AWS Elemental MediaLive 流延迟问题
- c# - 如何在 C# 中创建基本的 IFC 文件
- java - 如何使用用户输入创建对象
- php - PHPMailer:在 HTML 电子邮件中插入签名块
- apache-spark - 如何在 Spark SQL 中对名称中带有前导零的目录使用通配符?
- java - Android:模拟文本输入的正确方法(不是按键输入)
- javascript - 错误:不变量失败:您不应该使用
外面 使用 mbdreact - sql - 需要帮助来优化 ORACLE SQL 查询