Hi all,
I have a script which I am running to get the minimum date from a database table.
I've connected to the database and run the sql but when I try to get the result i get an error saying "No data exists for the row/column."
This is the code I have for it at the moment.1 Dim mySql As String = "SELECT MIN(LOSS_DATE) AS minDate FROM dbo_CLAIMS"
2 Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|NexusHolding.mdb;Persist Security Info=True"
3 Dim dbCon As New OleDbConnection(connectionString)
4
5 dbCon.Open()
6
7 Dim dbComm As New OleDbCommand(mySql, dbCon)
8 Dim dbRead = dbComm.ExecuteReader()
9 Dim minDate As String = dbRead.GetValue(0)
10
11 Response.Write(minDate)Thanks in advance for any help.
HI I am having problem with my Execute Reader. I am trying to insert values from 2 different tables into another table. SqlCommand comm2; SqlDataReader reader2; /* Grabs the stuff out of the database */ comm2 = new SqlCommand("SELECT HiraganaCharacter,HiraganaImage FROM Hiragana", getConnection()); /* opens the database */ comm2.Connection.Open(); /* starts the reader */ reader2 = comm2.ExecuteReader(); /* goes through the first array list */ for (int i = 0; i < checkedLetters.Count; i++) { /* find the data by using the array list value as a where clause */ comm2.CommandText = "SELECT HiraganaCharacter,HiraganaImage FROM Hiragana WHERE HiraganaCharacter ='" + checkedLetters[i] + "'"; /* reads through the data */ reader2.Read(); /* puts the ID- this id was set somewhere else */ CommQuickLinksItems.Parameters["@QuickLinkID"].Value = QuickLinkId; CommQuickLinksItems.Parameters["@CharacterName"].Value = reader2["HiraganaCharacter"].ToString(); CommQuickLinksItems.Parameters["@CharacterImagePath"].Value = reader2["HiraganaImage"].ToString(); CommQuickLinksItems.ExecuteNonQuery(); } for (int j = 0; j < checkedLettersKata.Count; j++) { comm2.CommandText = "SELECT KatakanaCharacter,KatakanaImage FROM Katakana WHERE KatakanaCharacter ='" + checkedLettersKata[j] + "'"; reader2.Read(); CommQuickLinksItems.Parameters["@QuickLinkID"].Value = QuickLinkId; /* line it dies on */ CommQuickLinksItems.Parameters["@CharacterName"].Value = reader2["KatakanaCharacter"].ToString(); CommQuickLinksItems.Parameters["@CharacterImagePath"].Value = reader2["KatakanaImage"].ToString(); CommQuickLinksItems.ExecuteNonQuery(); } CommQuickLinksItems.Connection.Dispose(); CommQuickLinksItems.Dispose(); comm2.Connection.Dispose(); comm2.Dispose(); My first question is there a better way to setup a SqlCommand to just get the connection and wait on the Command object text? Right now I am doing comm2 = new SqlCommand("SELECT HiraganaCharacter,HiraganaImage FROM Hiragana", getConnection());Which is kinda pointless since in the for loop I change the command to something different right away. At the same time though I don't really want to make a new SqlCommand object in the for loop since then everytime it goes through the loop it would then re grab the connection what I find pointless tooNow the problem How I have it right now it does not grab the right stuff. The first for loop works great and everything gets inserted. The next loop does not work It seems like it it trying to take the data from the first for loop and insert that stuff again since I get this error System.IndexOutOfRangeException was unhandled by user code Message="KatakanaCharacter" Source="System.Data" StackTrace: at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) at System.Data.SqlClient.SqlDataReader.get_Item(String name) at Practice.QuickLinks() in g:WebsiteJapanesePractice.aspx.cs:line 385 at Practice.btnQuickLink_Click(Object sender, EventArgs e) in g:WebsiteJapanesePractice.aspx.cs:line 411 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException: Basically what I did was for the first loop I chose 2 items and for the 2nd loop I chose 3 items. When it died on this line CommQuickLinksItems.Parameters["@CharacterName"].Value = reader2["KatakanaCharacter"].ToString();The value was "i" but that was one of the values I choose for the first for loop. It should have been either u,e,o. So I am not sure what I am doing wrong. I thought as long as I change the Command text I would not need to do anything else but it seems like I am missing something.
Hi. I'm trying to read data from a database. This is my code: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ connection.Open();SqlCommand cmd = new SqlCommand(sql, connection); myReader = cmd.ExecuteReader();if (myReader.Read()) { name1TextBox.Text = myReader.GetString(1); addr1TextBox.Text = myReader.GetString(2); code1TextBox.Text = myReader.GetString(5); tel1TextBox.Text = myReader.GetString(6); fax1TextBox.Text = myReader.GetString(7); : : ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The above code works fine until one of the GetString calls trys to return NULL (in this case myReader.GetString(5)). In other words, this code will run through about 30 rows of data until it runs in to a NULL entry for one of the columns. At that stage it's too late. I'm not allowed call GetString( ) on a NULL value. Is there anyway I can test the column entry before calling GetString( ). Regards (& thanks in advance) Garrett
when I execute the line: reader = comm.ExecuteReader(); Is there a way to get a count of the number of records returned (the query is a SELECT with no count in it)? I want to vary the display of the results set based on the number of records returned. For example if no records are returned I want it to display nothing, if one, I want the header to be in the singular, but if more than one record is returned, I want it to display the header in plural form. Here is my code snippet with further explanation of what I am trying to do:int Inumber = 0;foreach (string item in menuHeaders) {string title = menuHeaders[Inumber]; sp.Value = menuHeaders[Inumber]; Inumber++; conn.Open();reader = comm.ExecuteReader(CommandBehavior.CloseConnection); //Get the culture property of the thread.CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; //Create TextInfo object.TextInfo textInfo = cultureInfo.TextInfo; // WHAT I AM TRYING TO DO....... Here I would like to wrap this with an if statement, if Records returned by the reader are 0, skip while loop and header display // If one, then display in singular and if 2 add an s to the title. Convert to title case and display.content.Text += "<H3>" + textInfo.ToTitleCase(title) + "</H3>";while (reader.Read()) { content.Text += "<a href='" + reader["website"] + "'>" + reader["f_name"] + reader["l_name"] + "</a>"+ ", " +reader["organization"]+"<br />"; } //Close the connection. reader.Close(); conn.Close(); }
Hi. I am executing a stored procedure. The stored procedure raises an error and all I need is to catch this error. Pretty simple, but it only works with an ExecuteNonQuery and not with an Executereader statement. Can anybody explain to me why this happens?
Here's the sp:
CREATE PROCEDURE dbo.rel_test AS select 1 raiserror ('My error.', 11, 2) return GO
Here's the ASP.Net page:
<% @Page Language="VB" debug="True" %> <% @Import Namespace="System.Data.SqlClient" %> <script runat="server"> Public Function RunSP(ByVal strSP As String) As SqlDataReader Dim o_conn as SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionstring")) AddHandler o_conn.InfoMessage, New SqlInfoMessageEventHandler(AddressOf OnInfoMessage)
o_conn.Open
Dim cmd As New SqlCommand(strSP, o_conn) cmd.CommandType = System.Data.CommandType.StoredProcedure Dim rdr as SqlDataReader = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection) rdr.Close() cmd.Dispose()
Response.Write(o_conn.State)
End Function
Private Sub OnInfoMessage(sender as Object, args as SqlInfoMessageEventArgs) Dim err As SqlError For Each err In args.Errors Response.Write(String.Format("The {0} has received a severity {1}, state {2} error number {3}" & _ "on line {4} of procedure {5} on server {6}:{7}", _ err.Source, err.Class, err.State, err.Number, err.LineNumber, _ err.Procedure, err.Server, err.Message)) Next End Sub
Sub Page_Load(sender as Object, e as EventArgs) RunSP("rel_test") End Sub </script>
I am not seeing why this is not executing the reader, it just goes right by it when stepping through the code... command.CommandType = CommandType.StoredProcedure; // course command.Parameters.Add( "@courseId", courseId ); // Parameter: LessonName SqlParameter sLessonName = command.Parameters.Add( "@lessonName", SqlDbType.VarChar ); sLessonName.Size = 256; sLessonName.Direction = ParameterDirection.Output; // error code SqlParameter pErrCode = command.Parameters.Add( "@errCode", SqlDbType.Int ); pErrCode.Direction = ParameterDirection.Output; // execute the stored procedure SqlDataReader spResults; conn.Open(); spResults = command.ExecuteReader(); while( spResults.Read() ) // It never steps into the while statement like the reader is completed { RetrieveObjId objNames = new RetrieveObjId( spResults.GetString( 0 )); searchResults.Add( objNames ); } spResults.Close();And the stored procedure is.....CREATE PROCEDURE dbo.retrieveLessonNames @courseId VARCHAR(20), @lessonName VARCHAR(256) OUTPUT, @errCode INT OUTPUT ASBEGIN SELECT @lessonName = objName FROM objStructure WHERE courseId = @courseId SET @errCode = 0 RETURN @errCode HANDLE_APPERR: SET @errCode = 1 RETURNHANDLE_DBERR: SET @errCode = -1 RETURNENDGOSuggestions?Thanks all,Zath
I have VS 2005 and SQL CE 3.0. I sometimes get the a FileNotFoundException when I first use ExecuteReader. I believe this is because a dll has not been copied across because if I restart the emulator I can get it to work again.
Do I need to add a cab file/dll to my project to stop this happening?
I am currently tryinh to have this variable declared : Dim SQLLecteur As SqlDataReader = Command.ExecuteReader()And receiving the following error : 'ExecuteReader' is not member of 'String'.1. The ExecuteReader was not present in the list following the Command.2. The variable is declared from a : Public Shared Sub3. This sub is located in a code library referenced in the web.config as a namespace : <add namespace="PAX20070409" />4. If used directly in the .vb file within this sub : Protected Sub btnConnection_Click, I am not receiving any errors about the Dim.It is pretty clear why the code is not working, but I have not been able to find a way to fix the problem. I am currently trying to find a way to make the Dim work from within my code library. If you have any idea on how this could be achieve, it would be greatly apreciated.Thank you :)RV3
I'm writing my first vb.net app. Have a default page that uses a persons network login to query a database to get all their timekeeper id, firstname, last name, etc. But I keep getting this error. (My code is below) What am I missing??? ExecuteReader: Connection property has not been initialized. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: ExecuteReader: Connection property has not been initialized.Source Error:
Line 21: conn.Open() Line 22: Line 23: reader = comm.ExecuteReader() Line 24: If reader.Read() Then Line 25: EmployeesLabel.Text = reader.Item("tkinit") <script runat="server">Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)Dim conn As SqlConnectionDim comm As SqlCommandDim reader As SqlDataReaderDim connectionString As String = ConfigurationManager.ConnectionStrings("xxxConnectionString").ConnectionStringcomm = New SqlCommand("Select top 1 tkinit, tklast, tkfirst +' '+ tklast as fullname from txxx WHERE login = @login)", conn)comm.Parameters.Add("@Login", Data.SqlDbType.VarChar)comm.Parameters("@Login").Value = Me.User.Identity.Name.Substring(User.Identity.Name.IndexOf("") + 1)conn = New SqlConnection(connectionString)conn.Open()reader = comm.ExecuteReader()If reader.Read() ThenEmployeesLabel.Text = reader.Item("tkinit")FirstLastName.Text = reader.Item("fullname")End Ifreader.Close()conn.Close()End Sub</script>
I have a web form that is generating an error and I can't seem to figure out why for the life of me. Below is the code:
Private Sub VerifyNoDuplicateEmail() Dim conn As SqlConnection Dim sql As String Dim cmd As SqlCommand Dim id As Guid sql = "Select UserID from SDCUsers where email='{0}'" sql = String.Format(sql, txtEmail.Text) cmd = New SqlCommand(sql, conn) conn = New SqlConnection(ConfigurationSettings.AppSettings("cnSDCADC.ConnectionString")) conn.Open() Try 'The first this we need to do here is query the database and verify 'that no one has registed with this particular e-mail address id = cmd.ExecuteScalar() Response.Write(id.ToString & "<BR>") Catch Response.Write(sql & "<BR>") Response.Write("An error has occurred: " & Err.Description) Finally If Not id.ToString Is Nothing Then 'The e-mail address is already registered. Response.Write("Your e-mail address has already been registered with this site.<BR>") conn.Close() _NoDuplicates = False Else 'It's safe to add the user to the database conn.Close() _NoDuplicates = True End If End Try End Sub
Web.Config <appSettings> <!-- User application and configured property settings go here.--> <!-- Example: <add key="settingName" value="settingValue"/> --> <add key="cnSDCADC.ConnectionString" value="workstation id=STEPHEN;packet size=4096;integrated security=SSPI;data source=SDCADC;persist security info=False;initial catalog=sdc" /> </appSettings>
I have written a CLR Function in C#. The function works as expected except that I am trying to read data some data during the function call and get the following error:
Msg 6522, Level 16, State 1, Line 1
A .NET Framework error occurred during execution of user-defined routine or aggregate "fn_SLARemaining":
System.InvalidOperationException: ExecuteReader: Connection property has not been initialized.
System.InvalidOperationException:
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
RE: XML Data source .. Expression? Variable? Connection? Error: unable to read the XML data.
I want my XML Data source to be an expression as i will be looping through a directory of xml files.
I don't see the expression property or the connection property??
I tried setting the XMLData property to @[User::filename], but that results in:
Information: 0x40043006 at Load XML Files, DTS.Pipeline: Prepare for Execute phase is beginning. Error: 0xC02090D0 at Load XML Files, XML Source [108]: The component "XML Source" (108) was unable to read the XML data. Error: 0xC0047019 at Load XML Files, DTS.Pipeline: component "XML Source" (108) failed the prepare phase and returned error code 0xC02090D0. Information: 0x4004300B at Load XML Files, DTS.Pipeline: "component "OLE DB Destination" (341)" wrote 0 rows. Task failed: Load XML Files Information: 0xC002F30E at Bad, File System Task: File or directory "d:jcpxmlLoadjcp2.xml.bad" was deleted. Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "Package.dtsx" finished: Failure. The program '[3312] Package.dtsx: DTS' has exited with code 0 (0x0).
I am accessing SQL2005 with C# code using OleDbConnection.
A try and catch block catches the following error once a while between the Open() and Close() of the connection:
ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
I do not even have any idea where to start to debug this. The ExecuteNonQuery() runs a delete SQL query. It works 99.9% of the time. I do not see anything wrong when this error happens.
I am writing a query to return some production data. Basically i need to insert either 1 or 2 rows into a Table variable based on a decision as to does the production part make 1 or 2 items ( The Raw data does not allow for this it comes from a look up in my database)
I can retrieve all the source data i need easily but when i come to insert it into the table variable i need to insert 1 record if its a single part or 2 records if its a twin part. I know could use a cursor but im sure there has to be an easier way !
Below is the code i have at the moment
declare @startdate as datetime declare @enddate as datetime declare @Line as Integer DECLARE @count INT
set @startdate = '2015-01-01' set @enddate = '2015-01-31'
I have a customer-supplied stored procedure that returns a single row containing XML using the FOR XML EXPLICIT syntax against a SQL 2000 database.
When I run the proc in SQL Mgt console and save the XML to a file, I can read it in my SSIS package using the XML Source with no problem. I built the XSD from this file.
However, when I execute the proc within my package using the Exec SQL task using the XML Resultset option and saving the result to a String variable with package scope, and then try to read the XML into the XML Source from the variable, I get nothing. My data flow task runs to completion but it has no data.
The sproc seems to run fine. Is there a way I can look at the variable while the package is running to determine if it does have data? Anything else here I might be missing?
One other note, as a debugging measure, I put the SQL to execute the sproc in an OLE DB data source in my data flow task and tried to preview the data. When I did, all I got was "System.byte[]"...no XML. This is the same command I ran in the query window with no problems (copy/paste). I don't know if this is telling me I have a data-type issue or just if what I'm trying to do isn't allowed.
Hello Friends i have one problem, i have to need fatch the data from database . in the web form i take three grid view and i put the query "Select Top 1 coloum1 from tanlename order by newid()" . when the data came from database there is no sequence series . so i want to take fatch the data from database in variable like int a , b , c and call the data in those variable and put up in the feild
example :- welcome to Mr "Data call from data base (1) " how are you "Data call from data base (2)" bbye and "Data call from data base (3)" Answer "- welcome to Mr "ASHWANI" how are you FINE OR NOT" bbye and "TAKE CARE"
there is all capslock on value came from databse and these value in the web page store in a variable
like int a ; int b; int c; please help me please i have a huge problem Ashwnai
I need to connect Mysql database and get max(date) field from a table and store it in a variable OR if I can do it in Data flow then just to check the date with condition transform and move on...
I have installed mysql odbc. I have also made a odbc connection on conenction managers. looks ok...
I have tried Execute Task on Workflow but didnt work , Also tried datareader source connectiong mysql didnt work either
With Execute task I am getting ; [Execute SQL Task] Error: An error occurred while assigning a value to variable "Variable": "Value does not fall within the expected range.".
With Datareader source in data flow I am getting : Error at data flow task : Cannot acquire a managed connection from run time connection manager...
hi All, I have a string varaible passed to the SP something like : @var = 'v1#1@v2#1,2@v3#1,3,4,5'. Now i have to extract the data from this variable in such a way that : select * from var_data shud return like this : ID Role v1 1 v2 1 v2 2 v3 1 v3 3 v3 4 v3 5
Plz guide me how to achieve this result from the variable. Thanks in advance :-)
I can€™t figure out how to map xml data stored in a table to a variable in integration service.
For example: I would like to use a €śfor each loop container€? to iterate through a row set selected from database. Each row has three columns, an integer, a string and an xml data. In the variable mappings, I can map the integer column and the string column to a variable with type of int and a variable with type of string. But I am having trouble to map the xml data column to any variable. I tried using either a string variable or object. It always reports error like €śvariable mapping number X to variable XXX can€™t apply€?. Any help?
I am trying to extract certain data from MySQL (example sql statement is SELECT COLUMN1, COUNT(COLUMN2) FROM TABLE GROUP BY COLUMN1) and stored COLUMN1 and COUNT(COLUMN2) values into variables and then copy the values from the variables and insert them into a new table in sql server 2005 and has two columns in it (COLUMN1 of type nvarchar and COLUMN2 of type int). I can map the first output (COLUMN1) correctly to variable type String and store them in the new table in sql server 2005 (store the value in a variable type String and then use insert and store it into sql server using parameter in Execute Sql Task set the data type to NVARCHAR, but I cannot map the second output (COUNT(COLUMN2)) using the same method, I could not even get it to store into a variable of any type. Anyone have any idea how to go about it? Thanks in advance.
The output of the sql statement for MySQL should look like:
Hi there, i have written a page and for a long time it worked (or so i thought) now all of a sudden it dosnt. I have gone right back to basics and tried to only insert one variable, tried using a text box, a string pre populated, or a string populated by the text box - nothing seems to work. However if i hard code in the thing that i want, even into the SQL or into my param it works, whats going on! i think my programming skills are letting me down here! here is what i am trying to use (as you can see i have commented out all that i was using to get back to basics) Are there any pointers?SqlConnection objConnAddStock = new SqlConnection(sAddStock); //This is the sql statement. int intUpdateQSStockID = Convert.ToInt32(Request.QueryString["qsStockID"]); string strCondition;strCondition = "Brand New 12";using (objConnAddStock) { objConnAddStock.Open();string sqlAddStock = "UPDATE tbl_stock SET condition = @condition WHERE stock_id = " + intUpdateQSStockID;
Hello all, for a project I am trying to implement PayPal processing for orders public void CheckOut(Object s, EventArgs e) { String cartBusiness = "0413086@chester.ac.uk"; String cartProduct; int cartQuantity = 1; Decimal cartCost; int itemNumber = 1; SqlConnection objConn3; SqlCommand objCmd3; SqlDataReader objRdr3; objConn3 = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); objCmd3 = new SqlCommand("SELECT * FROM catalogue WHERE ID=" + Request.QueryString["id"], objConn3); objConn3.Open(); objRdr3 = objCmd3.ExecuteReader(); cartProduct = "Cheese"; cartCost = 1; objRdr3.Close(); objConn3.Close(); cartBusiness = Server.UrlEncode(cartBusiness); String strPayPal = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart&upload=1&business=" + cartBusiness; strPayPal += "&item_name_" + itemNumber + "=" + cartProduct; strPayPal += "&item_number_" + itemNumber + "=" + cartQuantity; strPayPal += "&amount_" + itemNumber + "=" + Decimal.Round(cartCost); Response.Redirect(strPayPal);
Here is my current code. I have manually selected cartProduct = "Cheese" and cartCost = 1, however I would like these variables to be site by data from the query. So I want cartProduct = Title and cartCost = Price from the SQL query. How do I do this?
select custno, amt, balance from customer where custno='customerno' when showcust='r' then select rows where amt<balance when showcust='c' then amt>balance etc if showcust='' then show everything
how to pass the numeric(12,0) data type to a variable in SSIS? what kind of variable data type should I choose? I am trying to assign object_key column ( numeric(12,0)) to a variable in SSIS
If i select int32 , it keep giving me an error: Error: 0xC001F009 at Row by Row process: The type of the value being assigned to variable "User::Object_Key" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
We can pass XML to the XML Source in a variable, but I haven't seen anywhere how much data can be passed this way? Is there a limit beyond the limits of system memory?
Also, what data types are valid for the variable? Just String?
Is there anyway to change the data type of a variable while in an expression? My problem is I am trying to compare a variable w/ a string data type to a variable w/ an object data type. I would change the data type of the variable from object to string but if I do that my sql task fails when it tries to write a value to that variable. The variable w/ the object data type is the result of an openquery sql stmnt. So I guess there are two ways around my problem.
1. Change data type of variable while in an expression..ie flow constriant or 2. Change data type of vraiable from object to string and still get the openquery result to work.
Hi all, By using for each loop container and script task, i am able to pick the file name from a specified folder to a user defined variable. Now i am trying to pass this variable to excel source (using data flow), but i am getting this error : -
===================================
Error at Data Flow Task [Excel Source [1]]: A destination table name has not been provided.
(Microsoft Visual Studio)
===================================
Exception from HRESULT: 0xC0202042 (Microsoft.SqlServer.DTSPipelineWrap)
------------------------------ Program Location:
at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.ReinitializeMetaData() at Microsoft.DataTransformationServices.DataFlowUI.DataFlowComponentUI.ReinitializeMetadata() at Microsoft.DataTransformationServices.DataFlowUI.DataFlowAdapterUI.connectionPage_SaveConnectionAttributes(Object sender, ConnectionAttributesEventArgs args)
Please can you suggest me how should i pass the vaiable to the data flow and how the Excel sheet will be selected there. Hi all, By using for each loop container and script task, i am able to pick the file name from a specified folder to a user defined variable. Now i am trying to pass this variable to excel source (using data flow), but i am getting this error : -
===================================
Error at Data Flow Task [Excel Source [1]]: A destination table name has not been provided.
(Microsoft Visual Studio)
===================================
Exception from HRESULT: 0xC0202042 (Microsoft.SqlServer.DTSPipelineWrap)
------------------------------ Program Location:
at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.ReinitializeMetaData() at Microsoft.DataTransformationServices.DataFlowUI.DataFlowComponentUI.ReinitializeMetadata() at Microsoft.DataTransformationServices.DataFlowUI.DataFlowAdapterUI.connectionPage_SaveConnectionAttributes(Object sender, ConnectionAttributesEventArgs args)
Please can you suggest me how should i pass the vaiable to the data flow and how the Excel sheet will be selected there.