Felmeddelande som jag får med viewSkapa tabeller funkar men ej skapa view vad är felet ????
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
Denna funkar utmärkt förutom att formuläret försvinner sedan den har körts klart
****************
Public Function skapatabell_snurra(ByVal namn As String)
Dim ska As String
Dim cn As New SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Valuta;Data Source=SMO;Packet Size=4096;Workstation ID=SMO")
cn.Open()
Dim createStr As String = "CREATE table " & namn & "(" & _
"Ind nvarchar(250)," & _
"Typ nvarchar(3)," & _
"Datum Datetime," & _
"Tid int," & _
"sigsort nvarchar(20)," & _
"sinee decimal(10,7)," & _
"prcsine decimal(10,7)," & _
"Esine decimal(10,7)," & _
"FCKE decimal(10,7))"
Dim createCMD As SqlCommand = New SqlCommand(createStr, cn)
createCMD.ExecuteNonQuery()
'MessageBox.Show(cn.State.ToString)
cn.Close()
End Function
Funkar ej
Public Function skapawiew(ByVal namn As String)
Dim ska As String
Dim cn As New SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Valuta;Data Source=SMO;Packet Size=4096;Workstation ID=SMO")
cn.Open()
Dim createStr As String = "CREATE View " & namn & " as SELECT Ind from ATF1mo go " '& _
Dim createCMD As SqlCommand = New SqlCommand(createStr, cn)
createCMD.ExecuteNonQuery()
'MessageBox.Show(cn.State.ToString)
cn.Close()
End Function
vad katten är felet ???