merhaba script ile veri tabanına daya yazmak istiyorum ama başarılı olamadım aşağıdaki kod ile yapmaya çaliştım
Dim SQL_cn As New SqlConnection()
SQL_cn.ConnectionString = “Server=(local)\WINTR\WinTr;uid=sa;pwd=12341234;database=dataproje”
SQL_cn.Open()
Dim SQL_Ins As String
‘Set Datetime Format
SQL_Ins = “SET DATEFORMAT dmy”
Dim SQL_date As SqlCommand = New SqlCommand(SQL_Ins, SQL_cn)
Dim SQL_cmdnon As SqlCommand = New SqlCommand(SQL_Ins, SQL_cn)
if tiptag = True Then
tip = “Sağ”
Else
tip= “Sol”
End If
sonuc=”OK”

‘Adding data
SQL_Ins = “INSERT INTO Table1(LastValue,DateTime,NotSet,tip,sonuc,tork1deger,tork2deger)”
SQL_Ins = SQL_Ins & ” VALUES(‘” & Row_Count & “‘,'” & Now & “‘,’0’,'” & tip & “‘,'” & sonuc & “‘,'” & Float_To_String(tork1)& “‘,'” & Float_To_String(tork2) & “‘)”
SQL_cmdnon = New SqlCommand(SQL_Ins, SQL_cn)
SQL_cmdnon.ExecuteNonQuery()
‘Close Database connection
SQL_cn.Close()
kontrol = True
Catch ex As Exception
‘ messagebox.show(ex.tostring,ex.message)
‘ ScriptError = ex.message

End Try
‘——- Script End Line ——-

End Sub
Function Float_To_String(Byval Sayi as Single)
return Sayi.ToString(“G”, CultureInfo.CreateSpecificCulture(“en-US”))
End Function

End Class
End Namespace