Hi all,
I'm in a bit of a bind and new to SQL.
I have built a DB using the SQL Manager and it works perfectly in my code.
I have used SQL Manager to build the SQL to rebuild my DB as I want to use it in my VB.Net code.
When I execute this SQL in the SQL management studio it works 100 %.
When I execute it in code I get an error: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. The RPC name is invalid."
All I'm trying to do is build the DB in code. I looked up the error in Google and there was one response which made no sense at all.
DBNew = "Server=" & DBServer & "SQLEXPRESS;Integrated Security=True;database=master"
Dim objConn As New SqlConnection(DBNew)
Try
objConn.Open()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Dim sr As StreamReader = New StreamReader("C:DevelopmentPureMatrixPureMatrixScriptsbuildDB.sql")
Dim script As String = sr.ReadToEnd
Try
Dim objCmd As New SqlCommand(script, objConn)
MsgBox(script)
objCmd.CommandType = CommandType.StoredProcedure
objCmd.ExecuteNonQuery()
catch
end try
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: