Format Parameter Error

Dec 26, 2006

Hi all, i am a newbie to reporting services. Hope someone can help me with this date problem.

I have a parameter date which i declared as type string in the report manager. when i entered the date as eg) "31/12/2003" and clicked on the 'preview' tab in the report manager, it gives me error saying that 'Cast from string "31/12/2003" to type 'Date' is not valid.'

So i use the cultureinfo function to set the date to 'en-US' format.... something like the one below:

CStr( Format(DateTime.Parse( Parameters!strDateTo.Value , New System.Globalization.CultureInfo("en-US")), "dd-MMM-yyyy"))

This works perfectly in my preview tab. But when i deployed to the server and when viewed on IE, it gives me an error msg -> "#Error" instead. Why is that so??

I have also checked my pc regional settings . It's set to United States and the date format is also "dd/MM/yyyy". Have also checked the settings in the server and it's also set to the same format. But i am still getting this error.

By the way... i am using windows 2003 with SRS 2000 SP2.

Any help will be appreciated. Thks !

View 1 Replies


ADVERTISEMENT

Parameter Date Format!

Feb 1, 2007

Hi,

How to control the Datetime Parameter's format, such as I need the user input Date and Time, but default, the user can only select date, but can not input the time.

How to solve it?

Thank you.

View 1 Replies View Related

Format Of Datetime Parameter

Mar 27, 2008



I have datetime parameter but SSRS used mm/dd/yyyy format.
How can I change to dd/mm/yyyy format ?

in dataset I used convert(datetime,@dateparam,103) but I get error if I select for example 14/03/2008
"The value provided for the report parameter 'dateparam' is not valid for its type

View 9 Replies View Related

Parameter Entered Has The Wrong Format.. You Must Be ....me!

May 17, 2006

Hi
I have the problem that the below defined paramter gets entered in the database as a interger. the Field in the DB is a nvarchar(5) and the controll that suplies the value is a TextBox
this is the parameter definition:<asp:ControlParameter ControlID="tbComment" Name="Comment" PropertyName="Text" Type="String" />
Why do I get this error, why does ASP to whant to make an integerfrom this text field? When putting a interger value in the textbox all works well and the data gets posted to the database.
I use a SqlDataSource with automatic generated script.
 
look forwart to a solution
walter

View 1 Replies View Related

DateTime Parameter Format Issue?

Nov 26, 2006

Hi All:

I create a report with a DateTime parameter, i would love to use DD/MM/YYYY this format, but it doesn't work . it works when i change to usa datetime format ,YYYY-MM-DD,

any helps are appreciated.

thanks

Nick

View 5 Replies View Related

Parameter Mapping Format String

Jun 12, 2007

Hi,

I have used Data Flow component that refers to named query of data source view. It is a OLE DB source.



The SQL Command property of data flow component shows SELECT * FROM Tablename as I defiend in named query. I have modified the query to accept a parameter as SELECT * FROM Tablename WHERE Status = ?



Now I need to pass the package variable to this parameter. How to I pass using ParameterMapping property?. What is correct way of passing the parameter mapping ? I tried with @[TestNS:tatus] variable. But it throws error The parameter mapping string is not in the correct format.



Thanks in advance



View 6 Replies View Related

Date Format - Parameter/Field

Jan 24, 2007

Hi,

I have some difficulties to format a Date value in my reporting service.

As you know you can use this kind of expression:

=DateTime.Parse(Parameters!ReportingDate.Value).ToString("dd/MM/yyyy")

But it does not work, and when I just want to use the format property of the textbox content such as "dd/MM/yyyy", it displays "dd/MM/yyyy", not the real formatted data, this property works for "=Today()" but not for parameters and fields. What is the diffrence?

Have you an idea to format a Parameter/Field of Date type such as dd/MM/yyyy?

Many thanks!

View 8 Replies View Related

Format Parameter Date - What's The Best Approach To Get Around This?

Sep 28, 2007

Hello,

Basically my situation is the server environment it seems to be all US region. Everything runs well. When local users attempt reports they get the format parameter issue because their machinese are all CDN region.

I've read through this forum and found quite a bit of people with the same issue of formatting the parameter date. And there are a bunch of recommendations for each scenario.

What i'm wondering is.... from all the experience of the users out here who have had that issue...what would be the most recommended way of fixing this issue? Would I change the server environment to CDN region and then change all the reports default language to English(Canada)? Or is there anything else someone might recommend.

I also read about this hotfix: FIX: The calendar control in a SQL Server 2005 Reporting Services report may display incorrect values http://support.microsoft.com/kb/940382/en-US but not sure if this would fix the problem.

Thanks for everyone's help.
Cheers!

View 1 Replies View Related

Creating An All Option For Parameter Value In GUID Format

Jan 31, 2007

I am working with SRS 2005 SP1 which no longer has the "ALL" option available on parameters. I am trying to create an "ALL" entry in a picklist so it can be used in a where clause for a dataset. I have a dataset with a union statement that creates a list of CRM usersids and names and an entry with a dummy guid with the name "All". Parameter is defined as a string type, with a dataset providing a list of users (label field) and their corresponding GUID value (value field), along with the an "All" entry.

select systemuserid, fullname
from FilteredSystemUser
Union
Select '00000000-0000-0000-0000-000000000000' as systemuserid, ' All' as fullname
order by fullname

The issue I am running into is implementing logic in another dataset referencing my parameter.

All is fine in the where clause if it is structured "where ownerid in (@Users)" but if I try to add logic to check for the "All" option "where (ownerid in (@Users) or @Users = '00000000-0000-0000-0000-000000000000') it errors out.

How do you impement "All" when you're dealing with a GUID type field? Thanks.

View 3 Replies View Related

Checking Format Of A String In Report Parameter

Aug 14, 2007

Is there a way to find out if the user entered the date in correct format for the report parameter? For example, I am using string data type and requring the user to enter date in yyyy/mm/dd format. Can I capture and prompt the user accordingly if the date string is not provided in the above format?

View 2 Replies View Related

Date Parameter Format Incorrectly Interpreted

Oct 18, 2005

Hi,

View 11 Replies View Related

Parameter Date Format - Change To Dd/mm/yyyy

Jun 25, 2007



Hi All,



I'm using report with a date parameter (user enters a date) and all transactions before that date are displayed. I don't know how to set parameter date format on the displayed report to dd/mm/yyyy.

If it's not a parameter I usually use sql " convert(varchar(10),datefield,103)" but don't know how to use this with parameter.



Thanks



Sonny

View 3 Replies View Related

DateTime Parameter Is In Wrong Format When Report Is Executed For The First Time

Dec 7, 2007

In my report I have two date parameters, both are of type DateTime.
The problem is that when the report is called for the first time the report parameter value is not shown in the expected format (de-DE, 01.01.2007) but in en-US 01/01/2007
Only when I change a Date using the calendar popup and click on the "show report" button, the right format will be taken over.

Language properties of the report are"=User!Language"
IE language is de-DE.
Report Server is a MS Windows Server 2003 R2 Standart Edition SP2
with MS SQL SERVER 2005 SP2


P.S.
on a server with MS SQL SERVER 2005 SP1, this report works fine.
may be this bug is a new feature of SP2?

View 13 Replies View Related

Transact SQL :: Pass Parameter To Convert Function To Format Decimal Precision Dynamically?

Nov 4, 2015

I want to change decimal precision dynamically without rounding value

For example

10.56788 value for 2 decimal precision is 10.56.
10.56788 value for 3 decimal precision is 10.567.
---CASE 1 without dynamic parameter---------
DECLARE @DECIMALVALUE AS tinyint
SELECT CONVERT(DECIMAL(10,2),500000.565356) As Amount

[Code] ....

I am getting error as follows......

Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '@DECIMALVALUE'

This decimal precision format value will vary  company to company ...

View 7 Replies View Related

SSRS Date Parameter - Showing Date Format On Right Hand Side

Jul 24, 2007

I am having report parameter end date I am showing the default value "5/21/2007 11:59:59 PM" in the end date paramter. And also I want to show date time format "(MM/DD/YYYY HH:MMS)" in the right hand side of the parameter. How to do this?



Thank You

View 1 Replies View Related

BULK INSERT ERROR Using Format File - Bulk Load Data Conversion Error

Jun 29, 2015

I'm trying to use Bulk insert for the first time and getting the following error. I think it might have something to do with my Format File and from the error msg there's a conversion error for the first column. In my database the Field is nvarchar(6) so my best guess is to use SQLNChar for the first column. I've checked the end of each line is CR LF therefore the is correct for line 7 right?

Msg 4863, Level 16, State 1, Line 1
Bulk load data conversion error (truncation) for row 1, column 1 (ASXCode).
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

BULK
INSERTtbl_ASX_Data_temp
FROM
'M:DataASXImportTest.txt'
WITH
(FORMATFILE='M:DataASXSQLFormatImport.Fmt')

[code]...

View 5 Replies View Related

Date Time Format For Date Parameter

Jan 24, 2008



Hello,

I am using the calender parameter and I need to convert my data date format to the one that matched that is returned on selecting a date from this calender. Can you show me what this format is.

how can I convert my existing date format to this format. The existing date format is 2007-07-26 21:27:13.000

thank you
Kiran

View 5 Replies View Related

DTS Error - Error String: The Parameter Is Incorrect.

Nov 28, 2001

HELP! im running this sql and get the following error - If i manually start the dts package it is fine....also if i use DTSrun from my pc it also works ok..

USE master

EXEC xp_cmdshell 'DTSrun /S BTN_AH_TWB02NEW /U pkent /P clarke05 /N pbk'


output
DTSRun: Loading...

Error: -2147024809 (80070057); Provider Error: 0 (0)

Error string: The parameter is incorrect.

Error source: Microsoft Data Transformation Services (DTS) Package

Help file: sqldts.hlp

Help context: 713




(9 row(s) affected)

View 2 Replies View Related

Money Format Error

Oct 10, 2006

I use asp.net 2.0 and sql server 2005 for a web site (and Microsoft enterprise library).When I run aplication at local there is no problem but at the server I take this error:Disallowed implicit conversion from data type varchar to data type money, table 'dbname.dbo.shopProducts', column 'productPrice'. Use the CONVERT function to run this query.productPrice coloumn format is money. It was working correctly my old server but now  it crashed.How can I solve this problem? And why it isn't work same configuration? My code:decimal productPrice;Database db = DatabaseFactory.CreateDatabase("connection");string  sqlCommand = "update shopProducts set ......................,productPrice='" + productPrice.ToString().Replace(",", ".") + "',..................... where productID=" + productID + " ";db.ExecuteNonQuery(CommandType.Text, sqlCommand)

View 1 Replies View Related

Time Format Error

Dec 20, 2005

What do you think of a query that generates aSystem.Data.SqlClient.SqlException when submitted via a application,but when run through QueryAnalyzer or EnterpriseManager doesn'tgenerate a error? Here are 2 examples of the query:SELECT table1.*,table2.field1,table2.field2,table2.field3 FROMtable1,table2 WHERE table1.field1 = table2.field1 ANDtable1.field2='103' ANDtable2.TStamp > '12/19/2005 12:20:14 PM' ORDER BY table2.TStampSystem.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '12'.SELECT table1.*,table2.field1,table2.field2,table2.field3 FROMtable1,table2 WHERE table1.field1 = table2.field1 ANDtable1.field2='103' ANDtable2.TStamp > '12/8/2005 8:29:43 AM'ORDER BY table2.TStampSystem.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '8'.I believe the error is referencing the hour portion of the timestamp.When I run these queries through QA/EM I don't get a result set ... somaybe those apps just trap the exception and ignore it. Still, seeanything wrong with the TStamp?

View 4 Replies View Related

Format Of The Initialization String Error

Apr 14, 2005

Hi all,
Complete newbie to ASP.NET, but you have to learn some time. Anyway, I am attempting to fill a datagrid from the Northwind database installed on my SQL server at work and I receive the following error when I attempt to compile to check the connection.
Format of the initialization string does not conform to specification starting at index 67.
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.ArgumentException: Format of the initialization string does not conform to specification starting at index 67.Source Error:



Line 31:
Line 32: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 33: Dim cnn As New SqlConnection( _
Line 34: "Data source=xxxxx;Initial Catalog=Northwind;User ID=sa;Password=;xxxxxx")
Line 35: End SubSource File: C:InetpubwwwrootApp_02default.aspx.vb    Line: 33 Stack Trace:



[ArgumentException: Format of the initialization string does not conform to specification starting at index 67.]
System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, String& keyname, String& keyvalue) +1203
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +127
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useFirstKeyValuePair) +103
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +32
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +25
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolOptions poolOptions, DbConnectionOptions& userConnectionOptions) +119
System.Data.ProviderBase.DbConnectionBase.set_ConnectionString(String value) +53
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +7
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +23
App_02.WebForm1.Page_Load(Object sender, EventArgs e) in C:InetpubwwwrootApp_02default.aspx.vb:33
System.Web.UI.Control.OnLoad(EventArgs e) +102
System.Web.UI.Control.LoadRecursive() +45
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +952

 I have been tearing my hair out trying to work out this error. Can anyone help????
Using VisualStudio.NET 2003 on an XP box and and SQL Server 2000 on a Windows2003 Server box.
Thanks,
Gerald

View 1 Replies View Related

Input String Format Error...Plz Help

May 16, 2005

Looking for some help with a page that is giving me problems. Below is code for the function that I need help with:
  Function MyInsertMethod() As Integer                  Dim connectionString As String = "server=chatt; user id='sa'; password=1234; database=chtt_Fit"& _                     "tings'"                  Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
                  Dim queryString As String = "INSERT INTO [ProcessYield] ([ProdDate], [CupolaCharge], [MetalPoured], [ToTen],[FeSiCharge],lt1,lt2,lt3,lt4) VALUES (@ProdDate, @CupolaCharge, @MetalPoured, @ToTen, @FeSiCharge,@lt1,@lt2,@lt3,@lt4)"                  Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand                  dbCommand.CommandText = queryString                  dbCommand.Connection = dbConnection
                  Dim ProdDate as String = Calendar1.selecteddate                  Dim ParameterProdDate as New SqlParameter("@ProdDate",SqldbType.datetime, 8)                  ParameterProdDate.Value = ProdDate                  dbCommand.Parameters.Add(ParameterProdDate)
                  Dim MetalPoured as String = TextBox3.Text                  Dim ParameterMetalPoured as New SqlParameter("@MetalPoured",SqldbType.float, 8)                  ParameterMetalPoured.Value = MetalPoured                  dbCommand.Parameters.Add(ParameterMetalPoured)
                  Dim CupolaCharge as String = Textbox1.Text                  Dim ParameterCupolaCharge as New SqlParameter("@CupolaCharge",SqldbType.float, 8)                  ParameterCupolaCharge.Value = CupolaCharge                  dbCommand.Parameters.Add(ParameterCupolaCharge)
                  Dim ToTen as String = Textbox4.Text                  Dim ParameterToTen as New SqlParameter("@ToTen",SqldbType.float, 8)                  ParameterToTen.Value = ToTen                  dbCommand.Parameters.Add(ParameterToTen)
                  Dim FeSiCharge as string = (Textbox5.Text/2000)                  Dim ParameterFeSiCharge as New SqlParameter("@FeSiCharge",SqldbType.float, 8)                  ParameterFeSiCharge.Value = FeSiCharge                  dbCommand.Parameters.Add(ParameterFeSiCharge)
                  Dim lt1 as String = TextBox6.Text                  Dim Parameterlt1 as New SqlParameter("@lt1",SqldbType.float, 8)                  Parameterlt1.Value = lt1                  dbCommand.Parameters.Add(Parameterlt1)
                  Dim lt2 as String = TextBox7.Text                  Dim Parameterlt2 as New SqlParameter("@lt2",SqldbType.float, 8)                  Parameterlt2.Value = lt2                  dbCommand.Parameters.Add(Parameterlt2)
                  Dim lt3 as String = TextBox8.Text                  Dim Parameterlt3 as New SqlParameter("@lt3",SqldbType.float, 8)                  Parameterlt3.Value = lt3                  dbCommand.Parameters.Add(Parameterlt3)
                  Dim lt4 as String = TextBox9.Text                  Dim Parameterlt4 as New SqlParameter("@lt4",SqldbType.float, 8)                  Parameterlt4.Value = lt4                  dbCommand.Parameters.Add(Parameterlt4)
                  Dim rowsAffected As Integer = 0                  dbConnection.Open
                  Try                      rowsAffected = dbCommand.ExecuteNonQuery                  Finally                      dbConnection.Close                  End Try                  Return rowsAffected              End Function
Ok the error happens when a user leaves the textbox5.text empty...pages says not to enter 0 since you can't divide into zero. This page has worked for over a year but recently upgraded from SQL 7.0 to SQL 2000 and is no longer working. 
Have tried converting data types, different data types on server, etc.  Any advise is appreciated. Thanks.  BTW new to forums... if this is wrong board to post on sorry and feel free to move where needed.
Here is submit code if that helps any also:
         Sub Button2_Click(sender As Object, e As EventArgs)             MyInsertMethod()             UpdateDailyActivity()             MXDataGrid1.DataSource = Getsaveresult()             MXDataGrid1.DataBind()             textbox1.text = ""             textbox3.text = ""             textbox4.text = ""             textbox5.text = ""             textbox6.text = "0"             textbox7.text = "0"             textbox8.text = "0"             textbox9.text = "0"
Error Message:
FormatException: Input string was not in a correct format.]   Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +195   Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String Value, NumberFormatInfo NumberFormat) +84[InvalidCastException: Cast from string "" to type 'Double' is not valid.]   Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String Value, NumberFormatInfo NumberFormat) +173   Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String Value) +7   ASP.CupolaYieldEntry_aspx.MyInsertMethod() in D:ProductionControlyieldcupolayieldentry.aspx:76   ASP.CupolaYieldEntry_aspx.Button2_Click(Object sender, EventArgs e) in D:ProductionControlyieldcupolayieldentry.aspx:142   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33   System.Web.UI.Page.ProcessRequestMain() +1292

View 1 Replies View Related

Invalid Date Format Error ... Please Help ...

May 2, 2002

Hi,

I'm using ODBC (System DSN) to connect to SQL Server 7.0 Database.
Whenever I try to connect to SQL Server Database from my client
application, I'm getting the following error message -

----------------------------------------------------------
Microsoft SQL Server has reported the following error:

[Microsoft] [ODBC SQL Server Driver] Invalid Date format
----------------------------------------------------------


After this message, I'm getting another error message -

----------------------------------------------------------

Cannot create a record in table SysConfig (SysConfig).
The SQL Database has issued an error.

----------------------------------------------------------

Subsequently, I get another error message -

-----------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Invalid date format [INSERT INTO SYSCONFIG

(CONFIGTYPE,ID,VALUE,MODIFIEDDATE,MODIFIEDTIME,MOD IFIEDBY,CREATEDDATE,CREATEDTIME,CREATEDBY,RECID

) VALUES (?,?,?,?,?,?,?,?,?,?)]
-----------------------------------------------------

The application that I'm trying to connect from is a package from 3rd
Party. I do not have any control over it.

But I think the problem could be from the side of SQL Server. Can someone
look into this please?

Thanks,
Harish

View 1 Replies View Related

I/O Error Reading BCP Format File

Jul 20, 2000

I added a field to an exisiting table (CHAR 30), and I added to field to the BCP Format File.
The BCP worked fine before the new field, and still works fine when I exclude the new field
from the format file, but with the new field I receive the following error:

SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]I/O error while reading BCP format file

(2 row(s) affected)

Here is a copy of my format file:
7.0
11
1 SQLCHAR 0 6 "" 1 Empl_ser_no
2 SQLCHAR 0 2 "" 2 Empl_stat_cd
3 SQLCHAR 0 1 "" 3 Guest_type_fl
4 SQLCHAR 0 30 "" 4 Job_tl
5 SQLCHAR 0 14 "" 5 Pager_no
6 SQLCHAR 0 1 "" 6 Security_Clear_fl
7 SQLCHAR 0 9 "" 7 SSN
8 SQLCHAR 0 30 "" 8 Emer_cont_nm
9 SQLCHAR 0 14 "" 9 Emer_cont_no
10 SQLCHAR 0 1 "" 10 Citizen_fl
11 SQLCHAR 0 30 "
" 11 Job_Res

The input file is just a fixed positonal text file, and I have checkid it 100 times- it is fine.

Any sugestions from any BCP gurus out there? THANKS

View 1 Replies View Related

Input String Was Not In A Correct Format. Error

Apr 16, 2008

I have a page where user can insert a new record, i use stroed procedures:ALTER PROCEDURE [dbo].[sp_InsertTypes]
@Type varchar(10),
@Type_Desc varchar(35),
@Contact_Name varchar(20),
@Contact_Ad1 varchar(25),
@Contact_Ad2 varchar(25),
@Contact_City varchar(10),
@Contact_Phone varchar(12),
@Contact_Fax varchar(12),
@Contact_Email varchar(35)
Insert into dbo.Types (Type,Type_Desc,Contact_Name,Contact_Ad1,Contact_Ad2,Contact_City,Contact_Phone,
Contact_Fax,Contact_Email) values (@Type,@Type_Desc,@Contact_Name,@Contact_Ad1,@Contact_Ad2,@Contact_City,
@Contact_Phone, @Contact_Fax,@Contact_Email)
My code is:Protected Sub InsertButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString)Dim myCommand As SqlCommand
Dim TypeTxt As TextBox = FormView1.FindControl("TypeTextBox")Dim DescTxt As TextBox = FormView1.FindControl("TypeDescTextBox")
Dim NameTxt As TextBox = FormView1.FindControl("ContactNameTextBox")Dim phoneTxt As TextBox = FormView1.FindControl("ContactPhoneTextBox")
Dim ad1Txt As TextBox = FormView1.FindControl("ContactAd1Textbox")Dim ad2Txt As TextBox = FormView1.FindControl("ContactAd2Textbox")
Dim cityTxt As TextBox = FormView1.FindControl("ContactCityTextbox")Dim faxTxt As TextBox = FormView1.FindControl("ContactFaxTextbox")
Dim emailTxt As TextBox = FormView1.FindControl("ContactEmailTextbox")myCommand = New SqlCommand("[dbo].[sp_Insert_Types]", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
myCommand.Parameters.Add("@Type", SqlDbType.BigInt).Value = TypeTxt.Text
myCommand.Parameters.Add("@Type_Desc", SqlDbType.VarChar).Value = DescTxt.Text
myCommand.Parameters.Add("@Contact_Name", SqlDbType.VarChar).Value =  NameTxt.Text
myCommand.Parameters.Add("@Contact_Phone", SqlDbType.VarChar).Value = phoneTxt.Text
myCommand.Parameters.Add("@Contact_Ad1", SqlDbType.VarChar).Value = ad1Txt.Text
myCommand.Parameters.Add("@Contact_Ad2", SqlDbType.VarChar).Value = ad2Txt.Text
myCommand.Parameters.Add("@Contact_City", SqlDbType.VarChar).Value =  cityTxt.Text
myCommand.Parameters.Add("@Contact_Fax", SqlDbType.VarChar).Value =  faxTxt.Text
myCommand.Parameters.Add("@Contact_Email", SqlDbType.VarChar).Value = emailTxt.Text myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
End Sub
 I have almost the identical procedure & code for Update command button, and worked well, what am I doing wrong? I even tried adding ' in front and after the texts.
Thank you.

View 5 Replies View Related

Help With Input String Was Not In A Correct Format Error

May 29, 2008

I am trying to execute an SQL update statement as follows:myObj.Query("Update Schedule Set visitorScore=" + t1 + ", homeScore=" + t2 + " where id=" + Convert.ToInt16(HID.Value));However, I'm getting the following error message with regards to this line.: Exception Details: System.FormatException: Input string was not in a correct format.  Could anyone please tell me what is wrong with this line?  I have tried many different versions of this, but keep getting the same error. THANKS IN ADVANCE! 

View 3 Replies View Related

Error: Input String Was Not In A Correct Format?

Oct 20, 2005

Hi experts,  I am working on my asp.net application and received an error message on   dr = cmdGetFile.ExecuteReader:Error: Input string was not in a correct format. Can someone help me out of this?  Thank you in advance.------------------------------------------------------------------------------------ #Region " Web Form Designer Generated Code "
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()        Me.cmdGetFile = New System.Data.SqlClient.SqlCommand        Me.dbHRConn = New System.Data.SqlClient.SqlConnection        '        'cmdGetFile        '        Me.cmdGetFile.CommandText = "SELECT App_Resume_FileSize, App_Resume_FileName, App_Resume, App_Resume_FileType " & _        "FROM Mgmt_App_Resume_Table WHERE (Applicant_ID = @AppID)"        Me.cmdGetFile.Connection = Me.dbHRConn        Me.cmdGetFile.Parameters.Add(New System.Data.SqlClient.SqlParameter("@AppID", System.Data.SqlDbType.SmallInt, 2, "Applicant_ID"))        '        'dbHRConn        '        Me.dbHRConn.ConnectionString = "the connection string"
    End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        Dim dr As System.Data.SqlClient.SqlDataReader        cmdGetFile.Parameters("@AppID").Value = Request("Applicant_ID")        dbHRConn.Open()        dr = cmdGetFile.ExecuteReader
        If dr.Read Then            Response.ContentType = dr("App_Resume_FileType").ToString            Response.OutputStream.Write(CType(dr("App_Resume"), _              Byte()), 0, CInt(dr("App_Resume_FileSize")))            Response.AddHeader("Content-Disposition", _              "attachment;filename=" + dr("App_Resume_FileName").ToString())        Else            Response.Write("File Not Found.")        End IfEnd Sub

View 5 Replies View Related

[mssql] I/O Error While Reading BCP Format File

Feb 29, 2000

Hi All,

I had a problem today where BCP would not read the format file I created giving the following error:

I/O error while reading BCP format file.

I searched the archives here at swynk.com and found a thread titled exactly the same as the one I am now creating. There were numerous responses to this thread but none of them seemed to solve the problem for me (short of the one that suggested using BCP to create the format file, which I didn't want to do).

I used BCP to create a format file for me (which looked identical to the format file that I created) and it worked fine. With my suspicions aroused, I used a binary file viewer to look at the contents of each file and highlight the differences. Apart from the usual variations in whitespace I noticed that the my file did not have any carriage returnline feed at the end of the last row definition.

My format file ended at the end of the last row definition line. It did not have any carriage returns and line feeds. I matched the one generated by BCP and added the following "

" to the end of the file, tested my format file and it worked perfectly.

The moral of the story is, make sure when you create a format file, you have an empty line at the end of the file (ie: after your last "Server Column Name", make sure you have "

" sans quotes).

Hope this saves someone a few hours :-)

Cheers,
Dan.

View 1 Replies View Related

Error When I Try To Bulk Insert With A Format File

Oct 1, 2007



Msg 4862, Level 16, State 1, Server PATH-SQLDEV, Line 2
Cannot bulk load because the file "c:DATABATCHBCPFormat.fmt" could not be read. Operating system error code (null).

Above is the error I get. The problem is I do not know what is causing this error. It occurs when I attempt to use SQLCMD with bulk insert.

I am using SQLserver 2005 and I have a similar set up in a test database that works, why this format file does not is beyond me, but my experience is when the format file has an error in it, such as a mispelled datatype or a incorrect column number, the error will zero in on that, rather then declare the entire file unreadable. Furthermore if I go into the file, change something so where it is incorrect (like a column number) it will zero in on that error. So I know that the format file can be read. If I knew what this error was all about I would at least know where to begin in fixing it. I have also tried using a very small sample file for the data being inserted. Same error.

Please help

View 2 Replies View Related

FTP Using DTS. Error Invalid Format For String Source Names

Mar 31, 2004

Hi,
I am trying to do a simple ftp using DTS. I am using a Dynamic properties task as the file name is a bit complicated eg - f2368fd1.ext.040330.2
where 040330 is according to the date and the .2 is the second file for the day.
When i run the task, it fails giving me the error "Invalid format for string source names"

I then tried to use a simple file name such as TD.txt as a constant in the Dynamic properties task but still it fails. Any ideas ??

Thanks in Advance

View 2 Replies View Related

MSRT - Error With Exporting The Reports To Excel Format.

Jul 26, 2007

I tried to export a report to excel format. I am getting the below error(Array Index out of bounds). The report is around 12 pages. Any thoughts on this?


Server Error in '/Reports' Application.


Index was outside the bounds of the array. 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.Exception: Index was outside the bounds of the array.

Source Error:





An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:





[Exception: Index was outside the bounds of the array.]

[Exception: An error occurred during rendering of the report.]

[Exception: An error occurred during rendering of the report.]
Microsoft.Reporting.WebForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension) +489
Microsoft.Reporting.WebForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension) +924
Microsoft.Reporting.WebForms.ServerReportControlSource.RenderReport(String format, String deviceInfo, NameValueCollection additionalParams, String& mimeType, String& fileExtension) +84
Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +153
Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +75
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Santhosh

View 2 Replies View Related

OLE DB Error: Format Of The Initialization String Does Not Conform To The OLE DB Specification.

Feb 11, 2008

It is SQL Server 2005. I am trying to create an SSIS package for OUR database engine with OUR OLE DB provider.

In Server Explorer I am trying to add a data connection for OUR database using OUR own ole db data provider. Procedure below-
1. Right click "Data Connections"
2. Click "Add Connection...", "Change Data Source" dialog is displayed.
3. Select "other" and ".NET Framework Data Provider for OLE DB". Click OK. "Add Connection" dialog is displayed.
4. Select "OLE DB Provider". I selected OUR provider.
5. Edit necessary properties. Click OK.
6. An error dialog is displayed saying "Format of the initialization string does not conform to the OLE DB specification."

I did some tracing. My observations are-

Connection string is built internally as
"Provider=MYOLEDB;Password=password;Data Source=myserver;User ID=admin;Initial Catalog=SYSTEM;Window Handle=984398;Prompt=CompleteRequired"

The last property causes this issue. i.e. presence of 'Prompt=CompleteRequired' is the problem.

I tried this with simple c# test program to connect. If I pass the whole connection string as above to OleDbConnection() it gives the error--
"Format of the initialization string does not conform to the OLE DB specification."

It works fine if I pass connection string removing last property, i.e.
"Provider=MYOLEDB;Password=password;Data Source=myserver;User ID=admin;Initial Catalog=SYSTEM;Window Handle=984398"

So the problem is that the connection string built contains 'Prompt=CompleteRequired' at the end. Our provider returns DBPROMPT_NOPROMPT for DBPROP_INIT_PROMPT property. Still why the connection string is built as 'Prompt=CompleteRequired'?

Probably this is because of missing something in properties/implementation. What is it?


Thanks,
Vivek.

View 4 Replies View Related

Error In Downloading EXCEL Format From Reporting Services

Oct 5, 2007



Hi

Can someone help debug this error while downloading to EXCEL format from RS? I notice that whenever i trim down the length of my report name, the error has not occurred.

The error encountered was:

View 2 Replies View Related







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