Specified Argument Was Out Of The Range Of Valid Values. Parameter Name: Index

May 21, 2007

This is the error I'm getting. I will paste my code below:
















"

DeleteCommand="DELETE FROM [Friends] WHERE [FriendName] = @FriendName"

SelectCommand="SELECT * FROM [Friends] WHERE (([FriendName] = @FriendName))"

UpdateCommand="UPDATE [Friends] SET [UserName] = @UserName, [UserID] = @UserID, [IP] = @IP, [AddedOn] =
@AddedOn, [FriendName] = @FriendName, [IsApproved] = @IsApproved WHERE [FriendID] = @FriendID">





























Type="String" />







DataSourceID="request_source" DefaultMode="Edit" EmptyDataText="You have no pending friend requests"

GridLines="None" Height="50px" Width="125px">









ReadOnly="True" SortExpression="UserName" />







Text="Accept" /> 

CommandName="Delete" Text="Deny" />







Text="Edit" /> 

CommandName="Delete" Text="Delete" />







ReadOnly="True" SortExpression="FriendID" Visible="False" />



















'>





'>

View 10 Replies


ADVERTISEMENT

Integration Services :: Argument For Option (parameter) Is Not Valid - The Command Line Parameters Are Invalid

May 6, 2015

i am parameterize  my DB connection in sql sever 2012,it showing in agent job as parameter.but when i run job it giving me error:

Argument "" for option "parameter" is not valid.  The command line parameters are invalid.  The step failed.

what i need to do is pass different environment here while deploying to different env.

View 2 Replies View Related

Index Was Out Of Range. Must Be Non-negative And Less Than The Size Of The Collection. Parameter Name: Index

Jan 22, 2006

Keep getting this error when positioning to the last page of a report.

Using Server 2003...SqlRpt Svcs 2000 sp2

Detail error msg:

Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. (rrRenderingError) Get Online Help

Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown.

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

Anyone have any suggestions?  Any way to find out what collection is blowing?...or where parameter name: index comes from?

View 47 Replies View Related

Parameter Valid Values

Sep 26, 2007

I am deploying an rdl that is being deployed in a server.But i am encountering a problem regarding the valid values of the parameter.My parameters have dependencies,and one of my parameter comes out with two dependencies.

Scenario :
User needs to input his userID to access Book A.
Book B needs Book A because the output will be depending on the its content.
And Book C depend on Book B.

Problem:
when deploying, only Book A will have the initial value.The dependency in Book B is only one,which is fine.It shows its valid values. But how about for Book C which have 2 dependencies? Because it doesnt show it's valid values..

View 3 Replies View Related

The Subscription Contains Parameter Values That Are Not Valid.

Feb 28, 2008



Hi,

We have a report server which has lots of reports. this particular report has 375 subscriptions and 80% of them are failing with the error "The subscription contains parameter values that are not valid." since last week nothing new was done on the server. when I open the properties of one of the subscriptions, one of the parameter value shows as a number where as it should be the name of a state.

Not sure what to do to get the subscriptions back.

any Ideas/help greatly appreaciated.

Thanks,
Phani

View 5 Replies View Related

The Subscription Contains Parameter Values That Are Not Valid

Mar 10, 2008

Hello,
I have something like 100 regular subscriptions.
It sometimes happen that one of the subscriptions suddenly stop to work with error "The subscription contains parameter values that are not valid". Example, one report has a dozen subscriptions, one of them stop to work. I look into the subscription and see that either one of the parameters is no longer set to a value or see nothing special besides the warning at the top of the subscription page. Parameters are all set to either default or some value(s). I reset one of the parameters, validate, or simply validate with no change and it works again.
Next time, in one or three weeks another subscription will fail, I will reset it.
Sometimes there are no errors, sometimes just 1 error and sometimes multiple errors accross reports or sometimes one report will suddenly have a few errors.
Right now, I use a weekly report to warn me after the fact of what were last week errors if any (no data, parameters unvalid, etc).
It looks like it happen with strings parameters based on datasets like "Sales offices" by example, where value and label are the same. Note that sales offices are by nature very stable, we do not change the spelling nor add remove entries. The list being a dataset gets rebuild, just to make sure we do not miss any eventual new sales office but if there is a new sales office, no one had a chance to select it as parameter value before it is in the dataset.
I am really not sure what is going on, were parameters values changed in the metadata? I do not think so.
Anyways, Is there a way to get an early warning instead of an after the fact error warning?
Is there anything else I coud try to "Refresh" or "remap" parameters values to avoid these errors?
When the subscription was created by a business analyst, If the parameters becomes blank, I have a hard time figuring out what it was when it was still valid. Is there any way to have a list of parameters values and have these values automatically "re-selected" by report server when the value gets lost?
This is not a big problem however it is annoying and people will have a bad perception of the system quality. "I created a subscription for Sacramento and never got my report", some people will also introduce garbage because they will create a new subscription instead of fixing the broken one, then they may eventually get twice the same report.
Any thought, does anyone had the same problem?

View 2 Replies View Related

Filtering Values In ResultSet By Setting Range On Complex Index

Aug 13, 2007

Hi!
I have table with complex index on 5 fields. One of them is string filed. I want to implement some sort of filtering, by setting SetRange() in my SQLCeCommand. But i need to fileter only by one string field and to get the values starting with the input string value.
I tried to use such code:
...
command.SetRange(DbRangeOptions.Prefix, new object[] {null, null, null, "Com", null}, null);
resultSet = cmd.ExecuteResultSet(ResultSetOptions.Scrollable);
....
But it doesn't work. As a result i've got an empty result set.
Usage of simple index on one field and setting the correspondent range will solve problem, but i can't have such index due to project restrictions.
Is there any way to set prefix range only by one value of complex index? If not, please, explain me how does Prefix Range works.

Thanx

View 1 Replies View Related

Argument Not Specified For Parameter

Apr 6, 2008

Hi,I'm working with visual studio 2008 and a sql server database. I'm also a bit of a beginner. I've written a stored procedure as below. My aim is to try and retrieve the data from field 'caption' through a paramater being passed.
I'm using the function as below to call this procedure through objectdatasource.
i'm getting the following error:
Compiler Error Message: BC30455: Argument not specified for parameter 'caption' of 'Public Sub New(id As Integer, count As Integer, caption As String, ispublic As Boolean)'.Source Error:





Line 98: Using reader As SqlDataReader = command.ExecuteReader()
Line 99: Do While (reader.Read())
Line 100: Dim temp2 As New Album(CStr(reader("Caption")))
Line 101: list2.Add(temp2)
Line 102: Loop
Any help will be apreciated, a lot of my code is copy and pasted and i don't fully understand every line which is where i assume the error is being made!
Thanks 
 
FUNCTIONSPublic Shared Function GetAlbumName(ByVal AlbumID As Integer) As Generic.List(Of Album)
Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Personal").ConnectionString)Using command As New SqlCommand("GetAlbumName", connection)
command.CommandType = CommandType.StoredProcedurecommand.Parameters.Add(New SqlParameter("@AlbumID", AlbumID))
connection.Open()Dim list2 As New Generic.List(Of Album)()
Using reader As SqlDataReader = command.ExecuteReader()Do While (reader.Read())Dim temp2 As New Album(CInt(reader("AlbumID")), CStr(reader("Caption")))
list2.Add(temp2)
Loop
End UsingReturn list2
End Using
End Using
End Function
 
SQL STORED PROCEDURE
ALTER PROCEDURE GetAlbumName@AlbumID int
AS
SELECT
*FROM [Albums]WHERE [Albums].[AlbumID] = @AlbumID
 
 
RETURN

View 2 Replies View Related

Argument Not Specified For Parameter

Apr 8, 2008

I try to replace the following statement : CmdPuzzle.Parameters.Append CmdPuzzle.CreateParameter("@Length",adTinyInt,adParamInput,,6)
 with:
Dim retLengthParam As New SqlParameter("@Length", SqlDbType.TinyInt, , 6)
it highlighted the retLengthParam saying:
Argument not specified for parameter 'size' of 'Public Sub New(parameterName As String, dbType As System.Data.SqlDbType, size As Integer, sourceColumn As String)
Logic:


set that the input is only allowed 6 integer.

View 3 Replies View Related

Return Last Valid Record When Query Is Outside The Range?

Dec 18, 2012

Using MSSQL 2008 R2

Given the following table

Code:
{ID, PropClass, OffSet, Amount}
{1, 1, 1, .30}
{2, 1, 2, .45}
{3, 1, 3, .50}
{4, 2, 1, .26}
{5, 2, 2, .15}

If I know the exact offset I can query easily enough using PropClass and the exact offset. But what if the offset is not included in the range for a given PropClass? How can I get a query to return the last valid record for a given PropClass from within a join?

For example, if my query contained PropClass = 1 and offset = 4, it should return the Amount of .50 from Record with ID 3

This is a query that I am trying to work on:

Code:
SELECT v.District, v.PropClass, YearAquired, SUM(cost * cnt), SUM(v.Cost * v.Cnt * t.Amount), SUM(v.Tax), COUNT(*)
FROM UPValue v
INNER JOIN UPMaster m on m.Year = v.year and m.Account = v.account
INNER JOIN UPTable T on t.PropClass = v.PropClass and t.Offset = v.Year - v.YearAquired
WHERE v.Year = 2012 and LeaseType = 2
group by v.District, v.PropClass, YearAquired
order by v.District, v.PropClass

Using <= will not work because that would return multiple records from UPTable when the offset is < the max offset.

View 4 Replies View Related

Get Records That Have Valid Date Range For Today

Aug 19, 2013

I want to get all records that have a valid date range for todays date(20130819).

All records have a date_f and date_t. I need to check that against todays date. The below code is my version of sql pseudo code.

SELECT DISTINCT
p.id,
p.name,
c.ip_number
FROM
tbl_Person AS p, tbl_current_conn_ipnumber AS c

[Code] .....

View 2 Replies View Related

Argument Not Specified For Parameter Error

Jan 16, 2005

I am trying to extract a value out of a cookie and then use that as a parameter to a SQL Select...Where function but I am getting the Argument not specified for parameter error. I assume the value from the cookie is not in the variable that I created but I could be wrong.

What is the proper method for populating a variable from a cookie and using that value as part of a SQL Select....Where function?

After I get a value out of the Select...Where function, I need to use the dataset results in a DropDownList as well as perform the DataBind().

here's some of the code:



Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
if Not Page.IsPostBack then
dim Code as String
Code = Server.HtmlEncode(Request.Cookies("UCodeCookie")("Code"))
label1.Text = Code
GetPropertyCodes(Code)
ddlPropertyCode.DataBind()
end if
End Sub

Function GetPropertyCodes(ByVal Code As String) As System.Data.DataSet
Dim connectionString As String = "server='(local)'; trusted_connection=true; database='master'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)

Dim queryString As String = "SELECT [Property_Details_db].[Prop_Code] FROM [Property_Details_db] WHERE ([Property_Details_db].[Code] = @Code)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection

Dim dbParam_code As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_code.ParameterName = "@Code"
dbParam_code.Value = Code
dbParam_code.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_code)

Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)

Return dataSet
End Function



Thanks for your help.

Chris

View 13 Replies View Related

Finding Valid Identity Range On Merge Subscriber

Nov 22, 2006

I am using merge replication with automatic identity range management

I want to be able to give a disconnected subscriber a warning message if a certain percentage of the allocated subscriber identity range has been used
- so that they can make sure they reconnect soon to obtain a new identity range

I can get the current identity value OK, but I can't find a good way of finding the current permitted primary and secondary ranges

The information is available in the check constraint, but I don't really want to have to parse this!

CONSTRAINT [repl_identity_range_0DF907AC_40CF_4849_9BD0_2173C90A3805] CHECK NOT FOR REPLICATION (([ContactID]>(10000040000.)
AND [ContactID]<=(10000050000.) OR [ContactID]>(10000050000.) AND [ContactID]<=(10000060000.)))

I can't find any system view which will provide this information

Is there a recommended way of doing this?

Thanks

aero1

View 3 Replies View Related

Analysis :: Column Argument Cannot Be Null Parameter Name

Jul 22, 2015

All I did was change the names on two measures in a measure group, tried to refresh the DSV and ka-blooey!

'column' argument cannot be null parameter name:column

View 3 Replies View Related

Argument Data Type For Dateadd Parameter

Mar 24, 2008



I am using the following code in my SQL stmt in my OLE BD Source stmt:

WHERE ICINVENTORY.ICINVLastChgAt > ? AND ICINVENTORY.ICINVLastChgAt <= DATEADD(mi,?,?)

My parameters are as follows:
0 - User:LastSalesLoadDate DateTime variable
1 - User:Load Interval Int16 (or Int32)
2 - User:LastSalesLoadDate

When I try to close the program I get the following error:

"Argument data type datetime is invalid for argument 2 of dateadd function. If I can't use a datetime data type for the date time part of the dateadd, what can I use?

The exact same code runs without error in an EXECUTE SQL task.

Thanks.

View 4 Replies View Related

The Index Is Not Valid.

Dec 1, 2006

I get this error in a package which was executing previously. This is in SQLServer OLEDB DATASOURCE 
Error at Membership_Other_Payer [DTS.Pipeline]: The index is not valid.
 
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC0048004 (Microsoft.SqlServer.DTSPipelineWrap)
 This error occurs when I try to open my existing Oledb datasource.  I have added some columns in my database
Any body has solution for this?

View 18 Replies View Related

Argument Data Type Varchar Is Invalid For Argument 3 Of Convert Function

Jan 25, 2013

Where did i do wrong in conversion

original query
dateadd(hour, datediff(hour,CONVERT(VARCHAR(19),B.CreateDate,111 ),B.CreateDate)

I tried to use convert(varchar(50),Datediff,21)

Below is the exact code..

convert(varchar(50),dateadd(hour, datediff(hour,CONVERT(VARCHAR(19),B.CreateDate,111 ),B.CreateDate),21)

View 10 Replies View Related

Argument Data Type Text Is Invalid For Argument 1 Of Replace Function.

May 14, 2008



Hi There,

Could someone please tell me why I am getting the above error on this code:

select (replace
(replace
(replace
(replace (serviceType, 'null', ' ')
, '<values><value>', ' ')
, '</value><value>', ',')
, '</value></values>', ' '))
from credit


serviceType (text,null)

Thanks,
Rhonda

View 1 Replies View Related

Lookup / Merge Join / Script - Howto Look Up Values By Comparing To A Range Of Values?

Jun 4, 2007

Hello all,

I am trying to think my way through a solution which I believe others have probably come across... I am trying to implement a matching routine wherein I need to match an address against a high value and a low value (or, for that matter an input date vs. a start and end date) to return the desired row ... i.e. if I were to use a straight vb program I would just use the following lookup:



"SELECT DISTINCT fire_id, police_ID, fire_opt_in_out, police_opt_in_out FROM ipt_tbl " & _

" WHERE zip_code = @zip_code AND addr_prim_lo <= @street_number AND addr_prim_hi >= @street_number " & _

" AND addr_prim_oe = @addr_prim_oe AND street_pre = @street_pre AND street_name = @street_name " & _

" AND street_suff = @street_suff AND street_post = @street_post " & _

" AND (expiry_date = '' OR expiry_date = '00000000' OR expiry_date > @expiry_date)" & _

" GROUP BY fire_ID, police_ID, fire_opt_in_out, police_opt_in_out"



My question, then, is how would you perform this type of query using a lookup / merge join or script? I have not found a way to implement a way to set the input columns? I can set the straight matches without a problem, i.e. lookup zip code = input zip code, but can't think of the correct way to set comparisons, i.e. lookup value 1 <= input value AND lookup value 2 >= input value



Any suggestions?



thanks for your time...

View 5 Replies View Related

SSIS Excel Source: Index Is Not Valid

Feb 27, 2006



An Excel Source Data Flow object (which used to work fine) sudenly started display the following error box:

TITLE: Microsoft Visual Studio
------------------------------
Error at Create BusStop Table [DTS.Pipeline]: The index is not valid.
ADDITIONAL INFORMATION:Exception from HRESULT: 0xC0048004 (Microsoft.SqlServer.DTSPipelineWrap)

What could the cause be?
What is the meaning of: HRESULT: 0xC0048004 ? How could this info be used?

Thanks and best regards,

Dan

View 6 Replies View Related

SQL 2012 :: Generating Date Range Values (start / End Dates) From Month Columns With Boolean Values

Jan 13, 2015

I've got some records like this:

ID_________Jan Feb...........................Dec
0000030257 0 0 0 0 0 0 1 1 1 1 1 0

where each month field has a 0 or 1, depending on if the person was enrolled that month.

I'm being asked to generate a table like this:

ID_________ Start_Date End_Date
0000030257 July 1, 2014 Nov 30, 2014

Is there some slam dunk way to do this without a bunch of If/Then statements?

The editor compressed all my space fields, so the column headers are off in some places.

View 8 Replies View Related

Subscription Parameter Not A Valid Value

Oct 4, 2007

Hi,

I'm trying to set up a data-driven subscription and having problems with parameters. On the Report Parameter Values screen of the Create Data-Driven Subscription function I have set a parameter TimesheetPeriodEnd to "Specify a static value" and checked the NULL box. In the report the parameter is type string and allows nulls. When I try to run the subscription the reports are not sent and the error log contains the following message:

ReportingServicesService!library!f!10/05/2007-09:31:08:: Status: Failure sending mail: Default value or value provided for the report parameter 'TimesheetPeriodEnd' is not a valid value.
ReportingServicesService!notification!f!10/05/2007-09:31:08:: Notification 0ae544df-4b1b-4a46-b7ab-cdefdca201be completed. Success: False, Status: Failure sending mail: Default value or value provided for the report parameter 'TimesheetPeriodEnd' is not a valid value., DeliveryExtension: Report Server Email, Report: Timesheet, Attempt 0

I am also setting other parameters for this subscription in the same way and not getting errors.

Any ideas? Previously I have had problems passing null values to parameters from the subscription query "Get value from database" from SELECT NULL AS ParameterName (this function just doesn't seem to work in SSRS). But I'm surprised I can't even seem to get this working with the default settings.

Regards,

Greg

View 5 Replies View Related

The String Was Not Recognized As A Valid DateTime. There Is A Unknown Word Starting At Index 0.

May 2, 2008

Hi,

I got this error report "The string was not recognized as a valid DateTime. There is a unknown word starting at index 0." at this line of code in BOLD.

For some reasons the datetime format in the database has the (US datetime format - 05/02/2008 06:40 instead of United Kingdom (UK date time format - 02/05/2008 06:40), as I had planned. I have tried to reformat the database and VB date format and all to no success.Could this be the root of my problems?










Code Snippet
Public Class Form1

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

If con.State = ConnectionState.Open Then con.Close()
con.Open()
cmd = New SqlCommand("SELECT REM_NOTE, REM_DATE FROM dbo.MY_CONTACTS", con)


Dim sdr As SqlDataReader = cmd.ExecuteReader
While sdr.HasRows = True

Dim newAlert As New Alert(Reminder_data_reader("REM_NOTE").ToString(), DateTime.Parse(Reminder_data_reader("REM_DATE").ToString()))
Me.collectionOfAlerts.Add(newAlert)


End If
End While
sdr.Close()
con.Close()

End Sub




End Class

View 3 Replies View Related

Valid Values In A Bit Defined Column

Jun 5, 2002

I have inherited a database that has a column defined as bit. Looking at BOL it shows the valid values are 0,1, null. However there are several rows of data which have -1. Is BOL wrong? we think a VB program runs an update which changes this.

View 1 Replies View Related

Reporting Services :: Value Of Parameter Param Is Not Valid

Jun 14, 2013

I am getting this error when upgraded to SQL Server 2012. Earlier the same report(.rdl) just working fine on SQL Server 2008 R2.

Message = System.Web.Services.Protocols.SoapException: The value of parameter 'param' is not valid. ---> Microsoft.ReportingServices. Diagnostics. Utilities.InvalidParameterException: The value of parameter 'param' is not valid. ---> System.UriFormatException: Invalid URI: The Uri string is too long.

Is there anything changed in SQL Server 2012 regarding this.

View 8 Replies View Related

System.FormatException: The String Was Not Recognized As A Valid DateTime. There Is A Unknown Word Starting At Index 0.

Sep 26, 2004

i cannot seem to get rid of this error. My page works in other functions that have the same syntax and format. just this one doesnt. i tried changing the format but still the same thing.
SQL DB is DateTime. Any Suggestions?


Function UpdateException(ByVal qID As String, ByVal exception_Status As String, ByVal completed As String, byval notes as string, byVal Username as string) As Integer
dim strDate as date = datetime.now()
dim strdate1 as string = strDate.tostring("MM-dd-yy")
Dim connectionString As String = "server='servername'; trusted_connection=true; Database='CPD_Reports'"
Dim sqlConnection As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(connectionString)

Dim queryString As String = "UPDATE [Master_CPD_Reports] SET [Exception_Status]=@Exception_Status, [Completed]"& _
"= @Completed, [Completion_Date]= @Completion_Date, [Username]= @Username WHERE ([Master_CPD_Reports].[QID] = @QID)"
Dim sqlCommand As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(queryString, sqlConnection)

sqlCommand.Parameters.Add("@QID", System.Data.SqlDbType.VarChar).Value = qID
sqlCommand.Parameters.Add("@Exception_Status", System.Data.SqlDbType.VarChar).Value = exception_Status
sqlCommand.Parameters.Add("@Completed", System.Data.SqlDbType.VarChar).Value = completed
sqlCommand.Parameters.Add("@Completion_Date", System.Data.SqlDbType.varchar).Value = strDate1
sqlCommand.Parameters.Add("@Username", System.Data.SqlDbType.DateTime).Value = UserName
dim NotesUpdate as string = "INSERT INTO [CPD_Notes] ([qID], [Notes], [Notes_Date], [Username]) VALUES (@qID, @notes, @Date, @UserName1)"
Dim sqlCommand1 As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(NotesUpdate, sqlConnection)
sqlcommand1.parameters.add("@qID", system.data.sqldbtype.varchar).value = qID
sqlcommand1.parameters.add("@Notes", system.data.sqldbtype.varchar).value = notes
sqlcommand1.parameters.add("@UserName1", system.data.sqldbtype.varchar).value = Username
sqlcommand1.parameters.add("@Date", system.data.sqldbtype.datetime).value = DateTime.now()
Dim rowsAffected As Integer = 0
trace.warn(strdate1)

sqlConnection.Open
Try
rowsAffected = sqlCommand.ExecuteNonQuery
Finally
End Try

dim rowsAffected1 as integer = 0

Try
rowsAffected1 = sqlCommand1.ExecuteNonQuery
Finally

End Try

Return rowsAffected
return rowsaffected1
sqlConnection.Close
End Function

View 4 Replies View Related

Valid Scope Values For The Function RowNumber(Nothing) ??

Nov 8, 2006

Hi there

I have a sales report that is pulling up data and displaying the detailed lines and the aggregate/summary lines grouped by a single field.

THe report say has 10 summary/aggregate lines and each summary lines have a maybe 20 more lines to it.

I want to NUMBER the SUMMARY lines only. In a new column on the summary line cell, if I type, =RowNumber(Nothing), I get a count of all its sub-lines displayed. How can I limit the scope of numbering to just the summary lines and make sure it does not include the sub lines involved ?

View 7 Replies View Related

Index Out Of Range Exception

Jan 20, 2008

Hi, I want to count the total number of rows in the table "members" and display this result in a ListBox. When I try to run this procedure I get an error message reading "Index out of range exception". What could this mean?
BTW, I know that the logic doesn´t make sense. I want to show the number of rows but I try to show a field name. Does anyone have solution, please? I would appreciate the help.
 
string connectionString2 = ConfigurationManager.ConnectionStrings["ServetteConnectionString"].ConnectionString; //CREATE CONNECTIONSTRING
string sQuery2 = "select count(*) from members"; //GET NUMBER OF ROWS
OleDbConnection oOleDbConnection2 = new OleDbConnection(connectionString2); oOleDbConnection2.Open(); //CREATE CONNECTION
OleDbCommand command2 = new OleDbCommand(sQuery2, oOleDbConnection2); CREATE COMMAND
OleDbDataReader reader2 = command2.ExecuteReader(); CREATE READER
while (reader2.Read())
{
ListBox1.Items.Add new ListItem(reader2["firstName"].ToString())); //THIS LINE RESULTS IN "INDEX OUT OF RANGE EXCEPTION" (STRANGE CODE LOGIC TOO)
}

View 2 Replies View Related

SQL 2012 :: Index Was Out Of Range

Oct 1, 2014

observed below error in sqlserver2012.index was out of range. Must be non-negative and less than the size of the collection.

View 2 Replies View Related

SSRS Index Out Of Range

Sep 5, 2007

I get this error when exporting to Excel from the designer or from the Report Manager:
"Exception: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"

One solution is:
(1) One Detail Cell in my table contained a number like #.#########. Aparently this freaks out Excel. I converted it to a string like this:
=Convert.ToString(Format((ReportItems!ValueOne.Value / ReportItems!ValueTwo.Value), "#.#########")) This sometimes works but makes the export have text fields and numbers under 0 show just .01 instead of 0.01 for example.

(2) Apparently disabling the Document Map Labels has the same effect and cures the problem - HOW DO YOU DO THIS?????? There is a label property for text boxes - but these are not populated.

Reading the internet..says that the SP2 for SQL server should slolve it. It hasnt.

please help..

Thanks
David

View 1 Replies View Related

(Report Model Deployment Error) The Value Of Parameter 'DataSources' Is Not Valid

Dec 12, 2005

I've got a report model I am trying to move from a development server to a production server.  I published it to my development RS, exported the SMDL file, then uploaded it to the production server.  At that point, I tried assigning the data source to the model and got the error:

View 12 Replies View Related

Index Was Out Of Range When Two Cells Are Merged

Jul 10, 2007

I receive this error during rendering when I have two cells merged together:




Error Snippet

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index



When I "Split Cells" on the offending cells, it starts to work. This report renders without error when run on the RS server. This error only occurs when running the report locally on the "Preview" tab in the report designer.



I have closed the IDE and deleted the *.data files and restarted with the same results. Is there anyway to get more information about the error to help debug the problem?



Thanks!



~Jon

View 2 Replies View Related

Index Was Out Of Range. Must Be Non-negative And Less Than The Size Of The Collection.

May 25, 2008

I'm Using a CLR for creating a trigger on database tables, 
This is my Exception :
A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightTrgg': System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ArgumentOutOfRangeException: at System.Collections.ArrayList.get_Item(Int32 index) at Triggers.AvailableFlightTrgg() . A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightInsert': System.Data.SqlClient.SqlException: A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightTrgg': System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ArgumentOutOfRangeException: at System.Collections.ArrayList.get_Item(Int32 index) at Triggers.AvailableFlightTrgg() . INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('283','50','23','4','2','6','15','1','5','4','5/25/2008 8:30:00 AM','5/25/2008 7:00:00 AM','6/26/2008 12:00:00 AM','5','AR2580','125','0','False','False','1','Flight created on 5/25/2008 00:00:00','1', 'I', GETDATE()); INSEA .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightTrgg': System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ArgumentOutOfRangeException: at System.Collections.ArrayList.get_Item(Int32 index) at Triggers.AvailableFlightTrgg() . A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightInsert': System.Data.SqlClient.SqlException: A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightTrgg': System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ArgumentOutOfRangeException: at System.Collections.ArrayList.get_Item(Int32 index) at Triggers.AvailableFlightTrgg() . INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('283','50','23','4','2','6','15','1','5','4','5/25/2008 8:30:00 AM','5/25/2008 7:00:00 AM','6/26/2008 12:00:00 AM','5','AR2580','125','0','False','False','1','Flight created on 5/25/2008 00:00:00','1', 'I', GETDATE()); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','7','125','125','0','0','Flight created on 5/25/2008 00:00:00','1'); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','4','25','25','20','20','Flight created on 5/25/2008 00:00:00','1'); The statement has been terminated. System.Data.SqlClient.SqlException: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.DispatchMessages(Boolean ignoreNonFatalMessages) at Microsoft.SqlServer.Server.SmiEventSink_Default.DispatchMessages(Boolean ignoreNonFatalMessages) at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteToPipe(SmiContext pipeContext) at Microsoft.SqlServer.Server.SqlPipe.ExecuteAndSend(SqlCommand command) at StoredProcedures.AvailableFlightInsert(Decimal AvailableFlightTimeTableID, Decimal Availabl... INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('283','50','23','4','2','6','15','1','5','4','5/25/2008 8:30:00 AM','5/25/2008 7:00:00 AM','6/26/2008 12:00:00 AM','5','AR2580','125','0','False','False','1','Flight created on 5/25/2008 00:00:00','1', 'I', GETDATE()); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','7','125','125','0','0','Flight created on 5/25/2008 00:00:00','1'); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','4','25','25','20','20','Flight created on 5/25/2008 00:00:00','1');RT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','7','125','125','0','0','Flight created on 5/25/2008 00:00:00','1'); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','4','25','25','20','20','Flight created on 5/25/2008 00:00:00','1'); The statement has been terminated. System.Data.SqlClient.SqlException: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.DispatchMessages(Boolean ignoreNonFatalMessages) at Microsoft.SqlServer.Server.SmiEventSink_Default.DispatchMessages(Boolean ignoreNonFatalMessages) at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteToPipe(SmiContext pipeContext) at Microsoft.SqlServer.Server.SqlPipe.ExecuteAndSend(SqlCommand command) at StoredProcedures.AvailableFlightInsert(Decimal AvailableFlightTimeTableID, Decimal Availabl... INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('283','50','23','4','2','6','15','1','5','4','5/25/2008 8:30:00 AM','5/25/2008 7:00:00 AM','6/26/2008 12:00:00 AM','5','AR2580','125','0','False','False','1','Flight created on 5/25/2008 00:00:00','1', 'I', GETDATE()); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','7','125','125','0','0','Flight created on 5/25/2008 00:00:00','1'); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','4','25','25','20','20','Flight created on 5/25/2008 00:00:00','1');
This is my Code :case TriggerAction.Insert:using (SqlConnection connection = new SqlConnection(@"context connection=true"))
{
connection.Open();command = new SqlCommand(@"SELECT * FROM INSERTED;", connection);
dr = command.ExecuteReader();
dr.Read();AvailableFlightID = (Decimal)dr[0];
AvailableFlightTimeTableID = (Decimal)dr[1];AvailableFlightAirlineID = (Decimal)dr[2];
AvailableFlightRoutingID = (Decimal)dr[3];AvailableFlightAPTerminalIDOrg = (Decimal)dr[4];
AvailableFlightAPTerminalIDDest = (Decimal)dr[5];AvailableFlightAirCraftID = (Decimal)dr[6];
AvailableFlightFlightStatusID = (Decimal)dr[7];AvailableFlightCateringID = (Decimal)dr[8];
AvailableFlightPayLoadTableID = (Decimal)dr[9];AvailableFlightArrTime = (DateTime)dr[10];
AvailableFlightDeptTime = (DateTime)dr[11];AvailableFlightDate = (DateTime)dr[12];
AvailableFlightDayName = (int)dr[13];AvailableFlightFlightNo = (String)dr[14];
AvailableFlightCapacity = (int)dr[15];AvailableFlightFreeBaggage = (int)dr[16];
AvailableFlightHaveChild = (bool)dr[17];AvailableFlightHaveParrent = (bool)dr[18];
AvailableFlightCommissionPercent = (int)dr[19];AvailableFlightRemark = (String)dr[20];AvailableFlightUserID = (Decimal)dr[21];
dr.Close();f (AvailableFlightID != 0)
{command = new SqlCommand(@"INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('" + AvailableFlightID + @"','" + AvailableFlightTimeTableID + @"','" + AvailableFlightAirlineID + @"','" + AvailableFlightRoutingID + @"','" + AvailableFlightAPTerminalIDOrg + @"','" + AvailableFlightAPTerminalIDDest + @"','" + AvailableFlightAirCraftID + @"','" + AvailableFlightFlightStatusID + @"','" + AvailableFlightCateringID + @"','" + AvailableFlightPayLoadTableID + @"','" + AvailableFlightArrTime + @"','" + AvailableFlightDeptTime + @"','" + AvailableFlightDate + @"','" + AvailableFlightDayName + @"','" + AvailableFlightFlightNo + @"','" + AvailableFlightCapacity + @"','" + AvailableFlightFreeBaggage + @"','" + AvailableFlightHaveChild + @"','" + AvailableFlightHaveParrent + @"','" + AvailableFlightCommissionPercent + @"','" + AvailableFlightRemark + @"','" + AvailableFlightUserID + @"', '" + "I" + @"', " + "GETDATE()" + @");", connection);
pipe.Send(command.CommandText);
command.ExecuteNonQuery();command = new SqlCommand(@"SELECT TimeTableSubClassSubClassID , TimeTableSubClassMaxCapacity, TimeTableSubClassWaitListCapacity FROM [SamaCRS].[dbo].[TimeTableSubClass] Where TimeTableSubClassTimeTableID = '" + AvailableFlightTimeTableID + "'", connection);
dr = command.ExecuteReader();
 System.Collections.ArrayList SubClassIDList = new System.Collections.ArrayList();
System.Collections.ArrayList SubClassCapacityList = new System.Collections.ArrayList();System.Collections.ArrayList SubClassWaitListCapacityList = new System.Collections.ArrayList();while (dr.Read())
{
SubClassIDList.Add(dr["TimeTableSubClassSubClassID"]);SubClassCapacityList.Add(dr["TimeTableSubClassMaxCapacity"]);SubClassWaitListCapacityList.Add(dr["TimeTableSubClassWaitListCapacity"]);
}
dr.Close();
SubClassIDList.TrimToSize();
SubClassCapacityList.TrimToSize();
SubClassWaitListCapacityList.TrimToSize();int CountID = SubClassIDList.Count;for (int i = 0; i <= CountID; i++)
{
command = new SqlCommand(@"INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('" + AvailableFlightID + @"','" +SubClassIDList[i] + @"','" +
SubClassCapacityList[i] + @"','" + SubClassCapacityList[i] + @"','" +
SubClassWaitListCapacityList[i] + @"','" + SubClassWaitListCapacityList[i] + @"','" +
AvailableFlightRemark + @"','" + AvailableFlightUserID + @"');", connection);
pipe.Send(command.CommandText);
command.ExecuteNonQuery();
}
 
////----------------------------------------
}
 
}
break;
 
this Code doesnt Work , but before writing this one I used the Code Below and It was working perfectly,
Previous Working Code :
//Initialize all TimeTable Classes for Created Flightcommand = new SqlCommand(@"SELECT TimeTableSubClassSubClassID FROM [SamaCRS].[dbo].[TimeTableSubClass] Where TimeTableSubClassTimeTableID = '" + AvailableFlightTimeTableID + "'", connection);
dr = command.ExecuteReader();
 System.Collections.ArrayList SubClassIDList = new System.Collections.ArrayList();while (dr.Read())
{
SubClassIDList.Add(dr.GetValue(0));
}
dr.Close();
SubClassIDList.TrimToSize();foreach (object AvailableFlightSubClassID in SubClassIDList)
{command = new SqlCommand(@"INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('" + AvailableFlightID + @"','" + AvailableFlightSubClassID + @"','" + AvailableFlightCapacity + @"','" + AvailableFlightCapacity + @"','" + 0 + @"','" + 0 + @"','" + AvailableFlightRemark + @"','" + AvailableFlightUserID + @"');", connection);
pipe.Send(command.CommandText);
command.ExecuteNonQuery();
}
 
Can ANy one Help me with this Exception , I have Checked The Tables for Number of Columns , its not from Column numbers ,I Think iys from For() Loop????????
 
 
 

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved