找不到运行时错误项目源代码,并且无效的字符串null异常? [英] runtime error project source code not found and invalid string null exception?

查看:31
本文介绍了找不到运行时错误项目源代码,并且无效的字符串null异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码正在运行,并且在3天之内多次编译和执行,但是突然出现错误,找不到源代码,我通过安装源代码汇编扩展名解决了它,但仍然有1个错误

My code was running and i compiled and executed many times in 3days but suddenly error appears sourrce code not found i resolved it by installing extension of source code assembly but still there is 1 error

即使我已经删除了连接字符串类,但在启动项目时仍然出现运行时错误

even i have removed connection string class but still runtime error while starting a project

检查图像,在运行或构建项目时出现错误

check image the error appears qwhen project is run or build

子新代码

 Public Sub New()
    InitializeComponent() 

    End Sub

推荐答案

您必须在连接字符串中再使用一个斜杠才能摆脱转义序列

You have to use One More Slash in Your Connection String To get rid of escape Sequence as

公共DBConn作为字符串= @数据源=.\ SQLEXPRESS;初始目录=商;集成安全性= True"

Public DBConn As String = @"Data Source=.\SQLEXPRESS;Initial Catalog=Quotient;Integrated Security=True"

OR

公共DBConn作为字符串="Data Source =.\\ SQLEXPRESS; Initial Catalog = Quotient; Integrated Security = True"

Public DBConn As String = "Data Source=.\\SQLEXPRESS;Initial Catalog=Quotient;Integrated Security=True"

由于连接字符串中有转义序列("\"),因此必须在连接字符串之前加上"@"符号

You must put "@" sign before Connection String as it there is a Escape Sequence ("\") in Connection String

这篇关于找不到运行时错误项目源代码,并且无效的字符串null异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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