Assume I have an asp.net/sql server 2000 web app in a shared hosting environment. I then encrypt the connection string using ProtectSection("DataProtectionConfigurationProvider") in the page load of my default.aspx page.
Am I understanding the following concepts then correctly?
1. I upload the site to the shared hosting server. 2. The first time I run the app eg. www.whatever.com/default.aspx, the ProtectSection method above is executed. 3. Now the conn string area of my web.config is encrypted, and asp.net will decrypt as needed.
4. If someone were to hack the server and view the web.config -- whether via getting into the server or via ftp, they would see an encrypted connection string. Thanks very much!
Above is my cnn string that is not working, it might be du to that m using SQLserver standard version ............ Do I have to change the cnn string.?
27.05 Gigabytes Usable Hard Drive Capacity 23.01 Gigabytes Hard Drive Free Space
COMPAQ CDR-8435 [CD-ROM drive] 3.5" format removeable media [Floppy drive] Compaq DDS3 12/24 GB DAT Drive [Tape drive]
IBM DCAS-34330W SCSI Disk Device (4.33 GB) -- drive 1 IBM DDRS-34560D SCSI Disk Device (4.57 GB) -- drive 2 IBM DDRS-34560D SCSI Disk Device (4.57 GB) -- drive 3 IBM-PSG ST318404LW !# SCSI Disk Device (18.19 GB) -- drive 0
192 Megabytes Installed Memory
Local Drive Volumes
c: (NTFS on drive 0) 18.19 GB 14.45 GB free
f: (NTFS on drive 3) 4.54 GB 4.26 GB free
g: (NTFS on drive 1) 4.33 GB 4.30 GB free
Network Drives
None detected
Microsoft SQL Server 2005 9.00.2047.00 ============================== OS Version : Microsoft Windows 2000 Advanced Server Service Pack 4 (Build 2195) Time : Mon Nov 06 15:22:52 2006
MAPSERV : The current system does not meet minimum hardware requirements for this SQL Server release. For detailed hardware requirements, see the readme file or SQL Server Books Online. MAPSERV : The system does not have the required version of Microsoft Data Access Components (MDAC) for this SQL Server release. For details, see Hardware and Software Requirements for Installing SQL Server 2005 in Microsoft SQL Server Books Online.
SQL Server Setup failed. For more information, review the Setup log file in %ProgramFiles%Microsoft SQL Server90Setup BootstrapLOGSummary.txt.
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")
************* Edited by moderator Adec *************** Inserted missing < code></ code> tags. Always include such tags when including code in your postings. Don't force the moderators to do this for you. Many readers disregard postings without the code tags. **************************************************
I've been workin on this a while and hope I just missed something simple. I have a login page that looks in the db for the rec_id that has the correct un/pw combo. Simple u'd think but I keep getting that error. Any help is greatly appreciated.
Private Sub CheckUser(ByVal CurrentSQLCommand As SqlCommand) 'Declare vars for user and pass. Not needed now but will be used for input checking later Dim strUN As String = txtUN.Text Dim strPW As String = txtPW.Text
SqlConnection1.Open() Dim datareader As SqlDataReader = CurrentSQLCommand.ExecuteReader While datareader.Read If datareader.HasRows Then txtID.Text = datareader(0) If txtR.Text = 3 Then Response.Redirect("hcprov.aspx?id=" & txtID.Text) ElseIf txtR.Text = 2 Then Response.Redirect("hcprof.aspx?id=" & txtID.Text) ElseIf txtR.Text = 1 Then Response.Redirect("hca.aspx?id=" & txtID.Text) End If 'CreateTicket() ElseIf Not datareader.HasRows Then txtUN.Text = "" txtPW.Text = "" lblError.Text = "This User/Pass combo is not valid please try again!" lblError.Visible = True End If datareader.Close() SqlConnection1.Close() End While End Sub
cmdCheckProfUser
SELECT REC_ID FROM dbo.HCPROFESSIONAL WHERE (UN = @un) AND (PW = @pw)
I am trying to do an insert into a SQL server table but I am getting an "input string was not in correct format" error. Does this error always refer to SQL string problem? I put in a breakpoint and looked at the SQL and it looks good but until I figure this out I will be tracing through the code. Any input greatly appreciated. MyCmd.CommandText = sSQL MyCmd.ExecuteNonQuery() 'Line where I get the errorThanks,Joe
im using asp.net, C# to enter data into a table in sqlserver...however im getting this error:Input string was not in a correct format.Description: An unhandled exception occurred during the execution ofthe current web request. Please review the stack trace for moreinformation about the error and where it originated in the code.Exception Details: System.FormatException: Input string was not in acorrect format.Source Error:Line 120:cmd.Parameters.Add("@commission",SqlDbType.Money);Line 121:cmd.Parameters["@commission"].Direction=ParameterDirection.Input;Line 122:cmd.Parameters["@commission"].Value =Convert.ToDouble(txtinvoice.Text);Line 123:cmd.Parameters.Add("@pricesold",SqlDbType.Money);Line 124:cmd.Parameters["@pricesold"].Direction=ParameterDirectionSimilar error messages appear when I leave text fields blank that aregoing to be inserted into fields in the table of datatype money,datetime or int...however when i execute this in query analyzer it works and inputs nullvalues for those fields:declare @empid varchar(20), @inventoryid int, @clientid int,@commission money,@pricesold money, @datesold datetime, @invoiceidint, @shippingcost money, @terms varchar(50), @details varchar(50),@clienttype smallint, @checker int, @errordesc varchar(100)set @empid = 'admin'set @inventoryid = 14set @clientid= 2set @clienttype = 0set @commission = nullexec STP_updateconsignment @empid, @inventoryid, @clientid,@commission,@pricesold, @datesold, @invoiceid, @shippingcost, @terms,@details, @clienttype, @checker output, @errordesc outputIf Im in enterprise manager and try to enter a blank value into one ofthose fields I get: The value you entered is not consistent with thedata type or length of the column...so im wondering if the C# page issending my stored procedure a blank value instead of a Null andcausing this error?any advice would be nice..thanks-Jim
Code SnippetSQL: select max(id) from t1 Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt) at System.Data.Odbc.OdbcDataReader.internalGetInt64(Int32 i) at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i, TypeMap typemap) at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i) at System.Data.Odbc.OdbcCommand.ExecuteScalar()
really strange error
this is the table t1 name varchar id bigint
select name from t1 works. select id from t1 gave me the same error as above too.
Is it because of its compatible with odbc connection for SQL Server 2005?
what is causing the problem?
Further updates!! select id from t1 works if data type is int instead of bigint !!! is this a problem with the SQL Server driver?
I'm connecting to the database via ODBC DSN by the way. OS is Windows Server 2003.
hi i have a database with some data in it and iam using full-text-search to search through my data and the search query works fine in sql server manamgnet studio. so my problem is in my web application, i have a textbox where i enter e.g car and click the search button, the button executes the search query but i recive an error "Input string was not in a correct format". here is the code that the button executes: Protected Sub searchButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) searchSqlDataSource.SelectCommand = "Select ID, title, FROM myTable WHERE CONTAINS(description, @search)" searchSqlDataSource.SelectParameters.Add("search", searchTextBox.Text) searchSqlDataSource.DataBind() End Sub tnx in advac
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.
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!
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
Hi, I need to concatenate a string with an int variable on a stored procedure; however, i looks like i am lost in single and double quotes. Does any one know the right comination of quotes for this please? My Code is below: 1 @Price int 2 3 DECLARE @SqlPrice varchar(50) 4 5 if (@Price is not null) 6 7 set @sqlPrice = 'AND price' + '' > '' + '' + @Price + '' 8
Ok, when I bind a textbox in my FormView I'm changing the format to currency (<%# Bind("TotalValue","{0:c}") %>). When I click Update I get "Input string was not in a correct format" since TotalValue is Int32 data type.
Shouldn't it convert it back to Int32 when it updates the db? Or do I have to do it manually, and if so how?
I get this error : [rsRuntimeErrorInExpression] The Value expression for the textrun ‘Textbox34.Paragraphs[0].TextRuns[0]’ contains an error: Input string was not in a correct format.
When i put this Expression in new field that i called C:
How can i perform this task with ssis OR TRANSACT SQL? I HAVE THESE ROWS WITH THE NEXT DATA, I want to take just the valid one, BUT I HAVE A LOT OF COMBINATIONS AS following names, it can be animals, things or personal names
GABRIEL OBANDO --CORRECT GABRIEL OVANDO Gavriel OVANDO gAbriel OBANDO GABRIE OBANDO Gabri OBONDA MANAGUA --CORRECT NANAGUA NAMAGUA
I added a connection (ADO.NET) object by name testCon in the connection manager - I wanted to programmatically supply the connection string. So I used the "Expressions" property of the connection object and set the connectionstring to one DTS variable. The idea is to supply the connection string value to the variable - so that the connection object uses my connection string.
Then I added a "Backup Database Task" to my package with the name BkpTask. Now whenever I try to set the connection property of BkpTask to the testCon connection object, by typing testCon, it automatically gets cleared. I am not able to set the connection value.
Then after spending several hours I found that this is because I have customized the connection string in testCon. If I don't customize the connection string, I am able to enter the "testCon" value in the connection property of the BkpTask.
Now I have the execute selectquerry function..... public static SqlDataReader ExecuteSelectQuerry(string querry) { try { SqlConnection conn = OpenConnection(); SqlCommand scomm = new SqlCommand(querry, conn); SqlDataReader sdr = scomm.ExecuteReader(); return sdr;
} catch (Exception e) { return null; } }}
now my question is....the instance of conn is limited only to that function only, and not returned outside. Whereas only the SqlDataReader is returned outside. Does that have any abnormal affect on the application. Since my ASP Application is getting locked (not doing anything, nt even post back!) sometimes after a few DB operation.
Arent these connections and instances Managed (auto garabage collection)?? Can memory leaks under such a situation occur. Please help
I have 2 DropDownList, the first one to display the product category and the other one to display the products based on the selected category. However, when I run code I received the following error message: Input string was not in a correct format. Please find the code below. Thanks, Andy. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"><title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Name"> </asp:DropDownList>
Hi, I'm having a BIG problem, this is my 3rd day looking for answer !I'm trying to create a custom membership provider with MS SQL database 2005 but not the default ASPNETDB. I've changed the web.config to be as following:<connectionStrings><add name="sqlConn" connectionString="Data Source=.;Integrated Security=True;Initial Catalog=ASPNETDB;"providerName="System.Data.SqlClient" /></connectionStrings> <system.web><trace enabled="true" /><roleManager enabled="true" /><authentication mode="Forms" /> <membership defaultProvider="MySqlProvider"><providers><remove name="AspNetSqlProvider"/><add name="MySqlProvider" connectionStringName="SqlConn" type="System.Web.Security.SqlMembershipProvider" applicationName="/" /></providers></membership> But when I try to login to the site using the login control the following error occurs: Server Error in '/etest' Application.
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.Source Error:
Line 149: <roleManager> Line 150: <providers> Line 151: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> Line 152: <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> Line 153: </providers>Source File: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Configmachine.config Line: 151
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.213 It is clear that this is a prblem with my Machine.Config file - since I've "worked!" on this file for a while. But when I've checked the Machine.config file I've found the LocalSqlServer connection it is talking about! . I'm lost and I dunno what to do, can anyone help? Here is the mahine.config in case if you need it:<connectionStrings> <add name="LocalSqlServer" connectionString="data source=.;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /></connectionStrings> <system.data><DbProviderFactories> <add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /></DbProviderFactories> </system.data><system.web> <processModel autoConfig="true" /><httpHandlers /> <membership><providers> <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /></providers> </membership><profile> <providers><add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </providers></profile> <roleManager><providers> <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /><add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </providers></roleManager> </system.web>
I am using sqljdbc41.jar to connect with MSSQL database, it is working fine on my local machine.Where as on the remote server, same class giving me error
Login failed for user '<domain><windows loginID>' My connection string is URL...
I am using sqljdbc41.jar and on 64 bit processor , I am using following command which included path for sqljdbc_auth.dll java -Djava.library.path= C: sqljdbc_4.1enuauthx64 TestDao and error is Login failed for user '<domain><windows loginID>' why it is not picking up username passed in connection string. I have 2 machines, one is local and other is remote. on both machine I login using my domain, it is working absolutely fine on local then why the error is coming on remote machine.Both the machines are identical.
I have been trying to host my website on Go Daddy for about 3 weeks and I have cleared several problems but this one remains. I can get into the ASPNETDB database for doing logins , etc but I cant access my database called "PINEmgt". To try to understand where the problem is located,I built a very simple application without login controls and put on it one Detailform accessing a single line table "Signin". I continually get the error message I got with my real app :"The connection name 'PINEMgtConnectionString2' was not found in the applications configuration or the connection string is empty. " There is only one connection string in my app -'PINEMgtConnectionString2'. When I run the app locally on my machine it works. After I move everything to Go Daddy, I get the error message and the following dump"
Line 24: </Fields> Line 25: </aspetailsView> Line 26: <aspqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStringsINEMgtConnectionString2 %>" Line 27: InsertCommand="INSERT INTO Signup(first_name, last_name, email, customer_id) VALUES (,,,)" Line 28: SelectCommand="SELECT * FROM [Signup]"></aspqlDataSource>
This is indeed the code from my single page app.
The dump is:
[InvalidOperationException: The connection name 'PINEMgtConnectionString2' was not found in the applications configuration or the connection string is empty.] System.Web.Compilation.ConnectionStringsExpressionBuilder.GetConnectionString(String connectionStringName) +3039085 ASP.default_aspx.__BuildControlSqlDataSource1() in d:hostinguck7scoutDefault.aspx:26 ASP.default_aspx.__BuildControlform1() in d:hostinguck7scoutDefault.aspx:10 ASP.default_aspx.__BuildControlTree(default_aspx __ctrl) in d:hostinguck7scoutDefault.aspx:1 ASP.default_aspx.FrameworkInitialize() in d:hostinguck7scoutDefault.aspx.vb:912306 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +40 System.Web.UI.Page.ProcessRequest() +86 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18 System.Web.UI.Page.ProcessRequest(HttpContext context) +49 ASP.default_aspx.ProcessRequest(HttpContext context) +29 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
After Googleing, asking Go Daddy for info (which they dont give) , etc for three weeks, I need serious mental help in the form of a solution of this problem. Your help with the problem or the name of a good mental health professional in eastern N.C. (maybe both) would be appreciated.
I have seen another thread with this same problem, but the problem seemed to be a typo. I am getting an error when I try to access the web site ..
The connection name 'USASH-AS0013' was not found in the applications configuration or the connection string is empty.
However, in my web.config file I do have a connection named USASH-AS0013. Here is my web.config file (with my user/pwd hidden). Any help would be greatly appreciated.
<?xml version="1.0"?> <!-- Note: As an alternative to hand editing this file you can use the web admin tool to configure settings for your application. Use the Website->Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in WindowsMicrosoft.NetFrameworkv2.xConfig --> <configuration> <appSettings/> <connectionStrings> <add name="USASH-AS0013" connectionString="Provider=SQLOLEDB;Data Source=USASH-AS0013;User ID=****;Password=*****;Initial Catalog="Smart Factory"" providerName="System.Data.OleDb" /> </connectionStrings> <system.web> <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development.
Visual Basic options: Set strict="true" to disallow all data type conversions where data loss can occur. Set explicit="true" to force declaration of all variables. --> <compilation debug="true" strict="false" explicit="true"/> <pages theme="MySkin" > <namespaces> <clear/> <add namespace="System"/> <add namespace="System.Collections"/> <add namespace="System.Collections.Specialized"/> <add namespace="System.Configuration"/> <add namespace="System.Text"/> <add namespace="System.Text.RegularExpressions"/> <add namespace="System.Web"/> <add namespace="System.Web.Caching"/> <add namespace="System.Web.SessionState"/> <add namespace="System.Web.Security"/> <add namespace="System.Web.Profile"/> <add namespace="System.Web.UI"/> <add namespace="System.Web.UI.WebControls"/> <add namespace="System.Web.UI.WebControls.WebParts"/> <add namespace="System.Web.UI.HtmlControls"/> </namespaces> </pages> <!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Windows"/> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace.