Hey all,
can someone help me, to translate my VBScript into VB.NET?
The SQL Command is'nt the problem....i've solved it like this:
SQL_INSIDER
can someone help me, to translate my VBScript into VB.NET?
Code:
set connection=createObject("ADODB.Connection") set command=createobject("ADODB.Command") Set fso = CreateObject("Scripting.FileSystemObject") Set MyFile = fso.CreateTextFile("\\SERVER\Logs\TextName.txt", True) connection.open "CONNECTION STRING" command.activeConnection=connection command.commandtext="SELECT * FROM BLABLA" ' 'NOW THE IMPORTANT PART!!!!! ' set recordset=command.execute Do Until recordset.EOF output = recordset.Fields("Context") recordset.movenext MyFile.Writeline output Loop MyFile.Close
The SQL Command is'nt the problem....i've solved it like this:
Code:
Private sub sqlconnection1() Dim sqlcon As New SqlConnection("CONNECTION STRING") sqlcon.Open() Dim sqlcom As New SqlCommand sqlcom.Connection = sqlcon sqlcom.CommandType = CommandType.Text sqlcom.CommandText = "SELECT * FROM BLABLA" sqlcon.Close() sqlcom.Connection = Nothing 'BUT now i don't know how can I go on..... like the example in my VBScript! End sub()