Format Of The Initialization String Does Not Conform To Specification Starting At Index 0
Jun 6, 2007
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 0.
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.
can't figure out this error. i think i'm writing something wrong in the connnection string. i'm using SQL Server Express, if that helps. in my config file: <connectionStrings> <add name="OfficialScribblerConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|OfficialScribbler.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings> in my aspx file:Dim DBConnection = New OleDbConnection("OfficialScribblerConnectionString") DBConnection.Open() Dim SQLString As String = "SELECT PostedDate From Entries_tbl ORDER BY PostedDate"
I received this error my server: [ArgumentException: Format of the initialization string does not conform to specification starting at index 0.] System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +1242 System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +128 System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +102 System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +52 System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24 System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +125 System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +56 System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4 System.Data.SqlClient.SqlConnection..ctor(String connectionString) +21 admin_ratings.Page_Load(Object sender, EventArgs e) +1345 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061 Here's my code, and this worked fine with the 3rd connection string on my local machine. It did the update to the proper fields in my db: Dim Original_WebsiteID As Integer = tblwebsiteRow.WebSiteID Dim conRatings As SqlConnection Dim strUpdate As StringDim cmdUpdate As SqlCommand conRatings = New SqlConnection(ConnectionString = "Connect Timeout=8; Integrated Security=True;Database=linkexchanger; Server=************;uid=****; pwd=********; ") 'conRatings = New SqlConnection(ConnectionString = "Connect Timeout=8; Initial Catalog=linkexchanger; Data Source=******; uid=*****; pwd=*****;") 'conRatings = New SqlConnection("Server=SCOTSQLEXPRESS;Initial Catalog=linkexchanger;Integrated Security=True;Connect Timeout=8;") strUpdate = "UPDATE tblWebSite SET Rating = " & Rate & "WHERE (WebSiteID = " & Original_WebsiteID & ")"cmdUpdate = New SqlCommand(strUpdate, conRatings) conRatings.Open() cmdUpdate.ExecuteNonQuery() conRatings.Close() Next End Sub
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."
If I go back to the "Add Connection" dialog(after clicking OK on error) and click "Advanced", I see connection string as-- Provider=OURPROVIDER;Data Source=our_backend;Password=password;User ID=admin;Initial Catalog=mydb
I am not able to find out what/where went wrong. I tried this conneciton string in a c# program, it works perfectly fine.
Can anyone help me on why I am getting this error with our provider in SSIS?
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?
I'm trying to build a connection string to SQL Server 7.0 from ASP.net w/ C#
I get the following error: Format of the initialization string does not conform to the OLE DB specification. Starting around char[100] in the connection string.
What the heck does this mean? What am I doing wrong.. My connection string is below:
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
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)
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
After converting from SQL Server 6.5 to 7.0, there exist a number of indices in sysindexes with names starting with _WA_Sys_, e.g. _WA_Sys_PGJ_GROUP_JOB_ID_3EA749C6. When a Complete Compare is executed in ERwin, these indices are reported as variances to the data model. When a DROP INDEX statement is executed, SQL Server complains that the index isn't in the system catalog. The following is an example:
DROP INDEX ASSIGNED_INSERTER_SETUP._WA_Sys_PGJ_GROUP_JOB_ID_3 EA749C6 Cannot drop the index 'ASSIGNED_INSERTER_SETUP._WA_Sys_PGJ_GROUP_JOB_ID_ 3EA749C6', because it does not exist in the system catalog. General SQL Server error: Check messages from the SQL Server. Execution Failed!
How do we drop these indices? Thank you in advance for your assistance.
I have date coming to one page as a string in the following format"May 4 2005 12:00AM" I need to query one of my tables using this date in combination of other nondate values. How can I convert this date into valid sql server datetime format before I query a database tables Please help
I have a table which stores date-of-birth in varchar 19861231(yyyymmdd). A view takes this data. I want to store this date as mmddyyyy in the view. How can we achieve this?
Hi allThis should be easy for one of you pros out there...I take a single string(one letter) from a textbox and want to query mydatabase for a name that starts with that letter.I know that the correct synthax when you know the letter is:WHERE FirstName LIKE 'O%'but when I have this:*****************Dim lastname As Stringlastname = txtlastname.TextDim strSQL As String = "SELECT * FROM [" & PubName & "] WHERE Last_Namelike ' txtlastname % ' "**********************************************It doesn't seem to work since my datagrid is empty afterwards. I alsotried:***************Dim strSQL As String = "SELECT * FROM [" & PubName & "] WHERE Last_Namelike '" & txtlastname & " % ' "****************without succes....It's probably just a synthax error on my part but I don'T know were..THanks guys!!JMT
When our rep distribution services time-out (several times a day) some dba's just restart the service while others restart the rep job which starts the service. Are there any differences between these two methods? Does restarting the service inherit any changes made to the job's attributes?
I am trying to configure the SelectedDatabases property of the Reorganize Index Task using an expression.
The Expressions property of the task provides the ability to configure the SelectedDatabases property of the task using an expression. The properties pane shows that the type of the SelectedDatabases property should be a "(Collection)" (which is edited using the 'Object Collection Editor').
How do I create an expression to configure the SelectedDatabases property? Can I build the collection in text? Or do I need to provide a variable of type System.Object that contains a collection type (and if so exactly what type should it contain)?
I have to convert From Sybase to SQL Server and I've got fields type in Sybase which are long varchar (length around 60000). At first, I convert in format text but SQL Server refused to pass this type for parameters in stored procedures when i need that. So I have used varchar(8000) in stored procedures. But I'm afraid it would be truncated in the application. So what is long varchar in SQL Server and how to use that by optimistic way ? Thanks
In this case i cant use cast(TimeDifference as decimal(16,2)) becasse eg : 12.98888882542533 values after writing this sql cast(TimeDifference as decimal(16,2)) gives me this result ===== 12.99====wrong!
i want to display like this 12.98
Ho do I do this task ? what is the best way to format like this ? Is there any straight methods to do this task ? sujithf
I do a select and concatinating the answers into a one column table @tab(string). Is it possible to format these values like this: GENAV DELAV TOTIP RES 12 myvalues www.notech.com 1 1 starthere 192.168.0.2 1 125 or here www.hereistomanychar.s 0
max 3 max 10 max 22 max 1
the first column max 3 characters the second column max 10 char... I want to do this to get a good view of the data i the table @tab
I'm retrieving data from a cube using a datareader, all the measures have format string, but when retrieve from Integration services it's lost.
I know there is a way to get the format string as columns using extended properties of the conection. I haven't tried this yet, but is there any way of reapplying this format to the columns using this format strings??
We have SQL 2000 (SP2) , Our SQL server agent showing green light as started from EM , It is succussfully restarting from NT Services too . But When I open the properties of the jobs from EM its gives error message SQL DMO error " SQl Agent is starting , try later " . And in EM Next run Date & Time not available .
MDDB database is accessable & in Log file its recovered fully
I get this error when executing a stored procedure from my code. I suppose something's going wrong with data types, but I cannot see what. If anyone has a sharper eye and can see what it is, please let me know. Thanks in advance!Here is a code excerpt: int category = Convert.ToInt32(ddlCategories.SelectedValue); int museum = Convert.ToInt32(ddlMuseums.SelectedValue); int collection = Convert.ToInt32(ddlCollections.SelectedValue); string binomen = txtScientName.Text; string locality = txtLocality.Text; command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@taxparent", category)); command.Parameters.Add(new SqlParameter("@museum", museum)); command.Parameters.Add(new SqlParameter("@collection", collection)); command.Parameters.Add(new SqlParameter("@binomen", binomen)); command.Parameters.Add(new SqlParameter("@locality", locality));And the stored procedure code: ALTER PROCEDURE [petrander].[DynamicQuery] @taxparent int = NULL, @museum int = NULL, @collection int = NULL, @binomen Nvarchar(254) = NULL, @locality Nvarchar(254) = NULLAS SELECT * FROM QueryView WHERE InstitutionCode = COALESCE(@museum, InstitutionCode) AND CollectionCode = COALESCE(@collection, CollectionCode) AND ScientificName LIKE '%' + @binomen + '%' AND Locality LIKE '%' + @locality + '%' AND ParentID1 = COALESCE(@taxparent, ParentID3) OR ParentID2 = COALESCE(@taxparent, ParentID2) OR ParentID3 = COALESCE(@taxparent, ParentID3) OR ParentID4 = COALESCE(@taxparent, ParentID4) OR ParentID5 = COALESCE(@taxparent, ParentID5) OR ParentID6 = COALESCE(@taxparent, ParentID6) OR ParentID7 = COALESCE(@taxparent, ParentID7) OR ParentID8 = COALESCE(@taxparent, ParentID8)
I am using SQL Server Express and Visual Web Developer Express with VB as my preferred language. I am trying to specify an InsertParameter with a querystring parameter of a SQLDataSource Control. My Code is: <InsertParameters> <asp:Parameter Name="ProjectID" Type="Int32" DefaultValue="Convert.ToInt32(Label1.Text)" /> <asp:Parameter Name="Name" Type="String" /> <asp:Parameter Name="Description" Type="String" /> <asp:Parameter Name="Size" Type="Int32" /> </InsertParameters> </asp:SqlDataSource> I get the error message above and the detail is: 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.FormatException: Input string was not in a correct format.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:
I have verified that Label1.Text has a value that looks like an integer. What is causing the problem? Is there a better way of creating a new record in the child table and making one of the fields match the primary key of the parent table? Thanks.
Hi!I get this message: System.FormatException: Input string was not in a correct format. when i try to execute this code: TextBox tbox = new TextBox(); string Date; string Title; string Text; string sUserName = HttpContext.Current.User.Identity.Name; MembershipUser User = Membership.GetUser(sUserName); string UserID = User.ProviderUserKey.ToString(); int NewsID = Convert.ToInt32(ViewEditNews.DataKeys[e.Item.ItemIndex]);
tbox = (TextBox)e.Item.FindControl("EditNewsDateTxt"); Date = tbox.Text;
tbox = (TextBox)e.Item.FindControl("EditNewsTitleTxt"); Title = tbox.Text;
tbox = (TextBox)e.Item.FindControl("EditNewsTextTxt"); Text = tbox.Text;
Hello, this is my code and the problem is "Input string was not in a correct format." Dim connection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("cnn"))
Dim percentage, jaar, kpi3, maand1 As IntegerDim cmd As SqlCommand = New SqlCommand
Hi i keep getting an error when i search based on the coachname textbox or the team name dropdown list, when I search based on the region dropdown list it works fine. The error i get is "Input string was not in a correct format" Here is my code; protected void Button1_Click(object sender, EventArgs e) {
if (this.IsValid) {
lblResults.Text = "Here are the search results!"; }
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["streamConnectionString"].ConnectionString); conn.Open();
SqlCommand command = new SqlCommand("stream_FindTeam", conn); command.CommandType = CommandType.StoredProcedure;
And my stored procedure is ALTER PROCEDURE [dbo].[stream_FindTeam] @coachName varchar(100), @TeamName varchar(100), @regionID INT AS SELECT TeamID, coachName FROM Teams WHERE coachName LIKE COALESCE(@coachName, coachName) AND TeamName = COALESCE(@TeamName, TeamName) AND regionID = COALESCE(@regionID, regionID);
Hi, im using vb,net sql 2005. I keep getting this error when inserting on one of my forms, normally i debug and have no probs solving this sort of thing but the error below isnt giving me anything to work on, could someone point me in the right direction. Any help would be appreciatedThanks
Hi,I am trying to Update using SqlDataSource.I get the error: Input string was not in a correct format. Does anyone know what would cause this?Thanks,Jon
Hi i hope someone can help with my problem, im quite nb to asp.net. while im trying to update or insert the record i encountered the this error Input string was not in a correct format. I only encounter this only in one field (value_char9) pls note this is varchar2 in the table. the problem encounter when i try to input value greater than sign e.g. >1000, but if there no symbol updating and insertion work fine. If PageMode = "Add" ThencmdSql = New OleDbCommand("Select id From r_feclas Where fec_key='" & strFType & "' And fec_type='PNTTYP' And code_status<>'I'", sqlConn)intKPTId = cmdSql.ExecuteScalar()'cmdSql = New OleDbCommand("Select mond.Nextval From dual", sqlConn) : intId = cmdSql.ExecuteScalar()Dim cmdSql2 As OleDbCommand = New OleDbCommand()Dim sqlTrans As OleDbTransaction = sqlConn.BeginTransaction()cmdSql2.Connection = sqlConn : cmdSql2.Transaction = sqlTransTry 'cmdSql2.CommandText = "Select last_doc_num From r_docnum Where doc_type='MOND' FOR UPDATE" 'intId = cmdSql2.ExecuteScalar() + 1 'cmdSql2.CommandText = "Update r_docnum Set last_doc_num=" & intId & " Where doc_type='MOND'" cmdSql2.CommandText = "Select Mond.NextVal From dual" intId = cmdSql2.ExecuteScalar()sqlTrans.Commit()Catch ex As ExceptionsqlTrans.Rollback()lblErrorMsg.Text = ex.Message : lblErrorMsg.Visible = TrueReturnEnd TrystrSql = "Insert Into r_mondat (read_date, value_num1, value_char1, value_char2, value_char3, value_char4, value_char5, " & _ "value_char6, value_char7, value_char8, value_char9, value_char10, value_char11, value_char12, " & _ "value_char13, value_char14, value_char15, value_char16, value_char17, value_char18, value_char19, Id, " & _ "last_updt, updt_user, created_on, created_by, tag, position, key_pnt, tag_fe_id, positn_fe_id, keypnt_fe_id, " & _ "key_pnt_type_grp, key_pnt_type, form_type, key_pnt_type_id) " & _ "Values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE,'" & Cache(Session.SessionID & "_UserId") & "',SYSDATE,'" & Cache(Session.SessionID & "_UserId") & "'," & _ "'" & strT & "','" & strP & "','" & strK & "'," & intT & "," & intP & "," & intK & ",'" & strFType & "','" & strFType & "','" & strFType & "'," & intKPTId & ")"ElseintId = dgrdData.DataKeys(0) strSql = "Update r_mondat Set read_date=?, value_num1=?, value_char1=?, value_char2=?, value_char3=?, value_char4=?, value_char5=?, " & _ "value_char6=?, value_char7=?, value_char8=?, value_char9=?, value_char10=?, value_char11=?, value_char12=?, " & _ "value_char13=?, value_char14=?, value_char15=?, value_char16=?, value_char17=?, value_char18=?, value_char19=?, " & _ "last_updt=sysdate " & "Where id=?" End If cmdSql = New OleDbCommand(strSql, sqlConn) cmdSql.Parameters.Add("@R1", OleDbType.Date).Value = dtDate cmdSql.Parameters.Add("@N1", OleDbType.Numeric).Value = GetValueFromDataGrid("N1") For i = 1 To 19 cmdSql.Parameters.Add("@C" & i, OleDbType.VarChar, 20).Value() = GetValueFromDataGrid("C" & i) Next cmdSql.Parameters.Add("@Id", OleDbType.Numeric).Value = intId Try cmdSql.ExecuteNonQuery() lblErrorMsg.Text = "Data Updated Successfully." dgrdData.EditItemIndex = -1 If PageMode = "Add" Then RetrieveLeakData(intId) Else RetrieveLeakData() Catch ex As Exception lblErrorMsg.Text = ex.Message Finally sqlConn.Close() End Try lblErrorMsg.Visible = True Trace.Write("lnkUpdate_Click End")