问题编译vb.net [英] Problem compiling vb.net
问题描述
在下面的代码中,它失败的原因是"
In the following code it is failing on "
昏暗
Conn 新建 SqlConnection(ConfigurationManager.ConnectionStrings(Database).ConnectionString)
Conn As New SqlConnection(ConfigurationManager.ConnectionStrings(Database).ConnectionString)
Conn.Open()";错误:"{对象引用未设置为对象的实例."}我确实加入了新的数据库连接(也有新的数据库,但所有列均相同),我如何确定要修复的特定代码是什么?
Conn.Open()" with the error: " {"Object reference not set to an instance of an object."} I did put in a new database connection (new database as well but all same columns) how do I determine what is the specific code to fix?
< ServiceContract(命名空间:=
<ServiceContract(Namespace:=
" )> _
"")> _
< AspNetCompatibilityRequirements(RequirementsMode:= AspNetCompatibilityRequirementsMode.Allowed)> _
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
公共
BudgetSvc
Class BudgetSvc
< OperationContract()> _
<OperationContract()> _
公共 Sub StageData( BatchGuid As Guid, ByVal 客户名称 As 字符串 ,_
Public Sub StageData(ByVal BatchGuid As Guid, ByVal CustomerName As String, _
ByVal FromDate As DateTime, ByVal ToDate As DateTime,_
ByVal FromDate As DateTime, ByVal ToDate As DateTime, _
ByVal BudgetID As 整数 , ByVal 数据库 As 字符串 )
ByVal BudgetID As Integer, ByVal Database As String)
昏暗 Conn As 新建 SqlConnection(ConfigurationManager.ConnectionStrings(Database).ConnectionString)
Dim Conn As New SqlConnection(ConfigurationManager.ConnectionStrings(Database).ConnectionString)
Conn.Open()
Conn.Open()
昏暗 Cmd As 新建 SqlCommand(
Dim Cmd As New SqlCommand("dbo.Budget_StageData", Conn)
Cmd.CommandType = CommandType.StoredProcedure
Cmd.CommandType = CommandType.StoredProcedure
Cmd.Parameters.AddWithValue(
Cmd.Parameters.AddWithValue(
"@ customername" ,CustomerName)
"@customername", CustomerName)
Cmd.Parameters.AddWithValue(
Cmd.Parameters.AddWithValue(
"@ fromdate" ,FromDate)
"@fromdate", FromDate)
Cmd.Parameters.AddWithValue(
Cmd.Parameters.AddWithValue(
"@ todate" ,ToDate)
"@todate", ToDate)
Cmd.Parameters.AddWithValue(
Cmd.Parameters.AddWithValue(
"@ guid" ,BatchGuid)
"@guid", BatchGuid)
Cmd.Parameters.AddWithValue(
Cmd.Parameters.AddWithValue(
"@ SavedBudgetID" ,BudgetID)
"@SavedBudgetID", BudgetID)
Cmd.ExecuteNonQuery()
Cmd.ExecuteNonQuery()
Conn.Close()
Conn.Close()
结束 Sub
End Sub
推荐答案
你好,
谢谢您的发帖!我建议将您的问题发布到其中之一Visual Basic开发人员中心> Visual Basic论坛> Visual Basic语言位于此处:
Thank you for your post! I would suggest posting your question in one of the Visual Basic Developer Center > Visual Basic Forums > Visual Basic Language located here:
http://social.msdn.microsoft.com/Forums/en/vblanguage/threads
希望这对您有所帮助.
祝你有美好的一天!
Hope this helps you.
Have a great day!
谢谢!
迪内什
第2层应用程序支持
服务器和工具在线运营团队
Thanks!
Dinesh
Tier 2 Application Support
Server and Tools Online Operations Team
这篇关于问题编译vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!