developed using asp.net and back end MS Accees database.
There is some database connectivity problem occurring when saving the information in page
url : http://vijayawadanalanda.org/feedback.aspx
getting error: Not a valid file name.
Please provide me solution to rectify this problem.
i used web.config for conndction string setting
web.config file code is
Expand|Select|Wrap|Line Numbers
- <?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
- \Windows\Microsoft.Net\Framework\v2.x\Config
- -->
- <configuration>
- <appSettings>
- <add key="con" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=http://vijayawadanalanda.org/dbnalanda/nalandavja.mdb;Persist Security Info=True"/>
- <add key="adminUsername" value="admin"/>
- <add key="adminPassword" value="123456"/>
- </appSettings>
- <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>
- <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="None"/>
- <!--
- 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.
- <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
- <error statusCode="403" redirect="NoAccess.htm" />
- <error statusCode="404" redirect="FileNotFound.htm" />
- </customErrors>
- -->
- <customErrors mode="Off" defaultRedirect="errorpage.htm">
- <!--<error statusCode="403" redirect="NoAccess.htm" />
- <error statusCode="404" redirect="FileNotFound.htm" />-->
- </customErrors>
- </system.web>
- </configuration>
feedback.aspx.vb code is
Expand|Select|Wrap|Line Numbers
- Imports System.Data
- Imports System.Data.OleDb
- Imports System.Configuration
- Partial Class feedback
- Inherits System.Web.UI.Page
- Dim con As New OleDbConnection(ConfigurationManager.AppSettings("con"))
- Dim cmd As OleDbCommand
- Dim dr As OleDbDataReader
- Protected Sub BtnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnCancel.Click
- TxtName.Text = ""
- TxtEmail.Text = ""
- RbtRank.SelectedIndex = -1
- TxtComments.Text = ""
- LblResult.Text = ""
- End Sub
- Protected Sub BtnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSubmit.Click
- Try
- Dim str As String = ""
- str = "INSERT INTO FEEDBACK_INFO(FB_NAME,FB_EMAIL,FB_RANK,FB_COMMENTS) VALUES('" & TxtName.Text & "','" & TxtEmail.Text & "','" & RbtRank.SelectedValue & "','" & TxtComments.Text & "')"
- cmd = New OleDbCommand(str, con)
- cmd.Connection.Open()
- cmd.ExecuteNonQuery()
- cmd.Connection.Close()
- LblResult.Text = "Thanks for your feedback"
- Catch ex As Exception
- LblResult.Text = ex.Message()
- End Try
- End Sub
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- End Sub
- End Class
Thankyou for any help