如何使用APP.CONFIG中的连接字符串进行数据插入.需要帮助 [英] How to USE Connection String in APP.CONFIG for Data insertion. HELP NEEDED

查看:82
本文介绍了如何使用APP.CONFIG中的连接字符串进行数据插入.需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用APP.CONFIG中的连接字符串进行连接.我是VB世界的新手.我在下面写下错误,请对我的代码进行更改.太谢谢你了

I am trying to connect using connection string in APP.CONFIG. I am new in VB world. I am getting error written below, please make changes into my code. Thank you so muc

导入System.Data.SqlClient
导入System.Configuration

Imports System.Data.SqlClient
Imports System.Configuration

推荐答案

错误:

{参数提示"不能转换为类型字符串"."}

什么是提示",它与您的代码无关,因为它与您发布的代码或连接字符串无关?

What is 'Prompt' where is it coming from in your code, because it has nothing to do with the code you have posted or the connectionstring?

您应该学习使用参数化的T-SQL

You should learn to use parameterized T-SQL

https://www.mssqltips. com/sqlservertip/2981/using-parameters-for-sql-server-queries-and-stored-procedures/


这篇关于如何使用APP.CONFIG中的连接字符串进行数据插入.需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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