Hello Suneetha,
This kind of issue is more complex than what is normally posted here in the Community. We suggest that you post your query in our TechNet Forum for better assistance.
Best Regards.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
the script task in control flow component shows below error every time it run.
the script language selected is VB 2015 and is basic -connects to sql server and reads table as below-
Dim FilePath As String = "c:\temp\cust.txt"
Dim Writer As StreamWriter = New StreamWriter(FilePath)
Dim Connection As String = "DataSource=<>;Initial Catalog=<>;Integrated Security=SSPI;"
Dim Query As String = "SELECT * FROM CUSTOMER"
Dim con As SqlConnection = New SqlConnection(Connection) 'TO ESTABLISH THE CONNECTION
Dim adp As SqlDataAdapter = New SqlDataAdapter(Query, con) 'TO EXECUTE THE QUERY
Dim ds As DataSet = New DataSet() 'TO INITIALIZE THE APPLICATION BUFFER
adp.Fill(ds) 'TO LOAD DATA FROM DATA SOURCE TO APPLICATION
With ds.Tables(0) 'TO ITERATE THRU EACH TABLE IN ABOVE DATASET
For R As Integer = 0 To .Rows.Count - 1 'TO ITERATE FOR EACH ROW
For C As Integer = 0 To .Columns.Count - 1 'TO ITERATE FOR EACH COLUMN
Writer.WriteLine("{0} : {1}", .Columns(C).ColumnName, .Rows(R)(C))
Next C
Writer.WriteLine(" ********************************************* ")
Next R
End With
Dts.TaskResult = ScriptResults.Success
below is the error-
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
Location of 2016 installed is - C:\Program Files (x86)\Microsoft SQL Server\2016\
Thanks
suneetha
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Hello Suneetha,
This kind of issue is more complex than what is normally posted here in the Community. We suggest that you post your query in our TechNet Forum for better assistance.
Best Regards.