<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Access Databases and AccessDataSource Control</title><link>http://forums.asp.net/55.aspx</link><description>Discuss using Access as a data store for ASP.NET, and the AccessDataSource control.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Bind Datarow[] with Dropdownlist</title><link>http://forums.asp.net/thread/3529556.aspx</link><pubDate>Tue, 24 Nov 2009 08:07:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3529556</guid><dc:creator>JavedBoqo</dc:creator><author>JavedBoqo</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3529556.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3529556</wfw:commentRss><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;i have&amp;nbsp;two dropdownlists and i want to fill second dropdownlist after selecting item from first dropdownlist. i have fill data in datatable and i am searching for specific items depend on value selecting in 1st dropdownlist using following lines of code&lt;/p&gt;
&lt;p&gt;&lt;font color="#2b91af" size="4"&gt;
&lt;p&gt;DataRow&lt;font size="4"&gt;[] dr=MYDT.Select(&lt;/font&gt;&lt;font color="#a31515" size="4"&gt;&amp;quot;SMCODE =&amp;#39;&amp;quot;&lt;/font&gt;&lt;font size="4"&gt;+cmbSalesman.SelectedValue.ToString()+&lt;/font&gt;&lt;font color="#a31515" size="4"&gt;&amp;quot;&amp;#39;&amp;quot;&lt;/font&gt;&lt;font size="4"&gt;); &lt;/font&gt;&lt;font color="#a31515" size="4"&gt;&amp;quot;PNAME&amp;quot;&lt;/font&gt;&lt;font size="4"&gt;;&lt;/font&gt;&lt;font color="#a31515" size="4"&gt;&amp;quot;SMCODE&amp;quot;&lt;/font&gt;&lt;font size="4"&gt;;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;cmbParty.DataSource = dr;&lt;/p&gt;
&lt;p&gt;cmbParty.DataTextField = &lt;/p&gt;
&lt;p&gt;cmbParty.DataValueField = &lt;/p&gt;
&lt;p&gt;cmbParty.DataBind();&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color="#2b91af" size="4"&gt;but it gives following runtime error:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;DataBinding: &amp;#39;System.Data.DataRow&amp;#39; does not contain a property with the name &amp;#39;PNAME&amp;#39;.&lt;/p&gt;
&lt;p&gt;any idea&lt;/p&gt;</description></item><item><title>LinkButton vs Button Events for Data Update</title><link>http://forums.asp.net/thread/3525884.aspx</link><pubDate>Sat, 21 Nov 2009 20:44:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3525884</guid><dc:creator>QUL001</dc:creator><author>QUL001</author><slash:comments>8</slash:comments><comments>http://forums.asp.net/thread/3525884.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3525884</wfw:commentRss><description>&lt;p&gt;I have used a Button event to update an Access Database with VB code, as follows:&lt;/p&gt;
&lt;p&gt;Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GRName = TextBox1.Text&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GRCompany = TextBox2.Text&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con.Open()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd = New OleDbCommand(&amp;quot;Insert Into Table1(Name, Company) Values (@NameParam, @CompanyParam)&amp;quot;, con)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.AddWithValue(&amp;quot;@NameParam&amp;quot;, GRName)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.AddWithValue(&amp;quot;@CompanyParam&amp;quot;, GRCompany)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.ExecuteNonQuery()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;However, the same procedure does not work for a LinkButton event, with the exact same code as above but substituting LinkButton for Button.&amp;nbsp; Is there a problem with using a LinkButton control to execute such commands?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Problem Filling a DataSet</title><link>http://forums.asp.net/thread/3518637.aspx</link><pubDate>Tue, 17 Nov 2009 23:57:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3518637</guid><dc:creator>ryguy7272</dc:creator><author>ryguy7272</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3518637.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3518637</wfw:commentRss><description>&lt;p&gt;I am having a small problem filling a DataSet.&amp;nbsp; I thought I had a handle on this, because I
did something quite similar earlier today, but this version (slightly different
from the other) is not working.&amp;nbsp; Below is
my code:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;% @Register Namespace=&amp;quot;DataControls&amp;quot;
Assembly=&amp;quot;DataCalendar&amp;quot; TagPrefix=&amp;quot;dc&amp;quot; %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;% @Import Namespace=&amp;quot;System.Data&amp;quot; %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% @Import Namespace=&amp;quot;System.Data.Sql&amp;quot; %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% @Import Namespace=&amp;quot;System.Data.SqlClient&amp;quot; %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;script language=&amp;quot;vb&amp;quot;
runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Function
GetConnection() as SqlConnection&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim conn
As New SqlConnection(&amp;quot;Server=EXCEL-4J2W8KYNP\SQLEXPRESS;database=PubCrawls;Trusted_Connection=Yes;&amp;quot;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return
conn&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Function
GetEventData(startDate as DateTime, endDate as DateTime) as DataTable&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim conn
as SqlConnection = GetConnection()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim cmd
as SqlCommand = new SqlCommand()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
cmd.Connection = conn&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
cmd.CommandText = String.Format(&amp;quot;Select EventDate, Count(*) From
Events Where EventDate &amp;gt;= #{0}# And EventDate &amp;lt;= #{1}# Group By
EventDate&amp;quot;, _&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;startDate, endDate)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim ds
as DataSet = new DataSet()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim da
as SqlDataAdapter = new SqlDataAdapter(cmd)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
da.Fill(ds)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
conn.Close()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return
ds.Tables(0)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;/p&gt;
&lt;p&gt;...some more code down here...never even get this far...&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The code fails on this line:&lt;/p&gt;
&lt;p&gt;da.Fill(ds)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The message is:&lt;/p&gt;
&lt;p&gt;Sql expression was unhandled
by user code.&lt;/p&gt;
&lt;p&gt;Incorrect syntax near ‘12’.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The 12-thing is baffling
me.&amp;nbsp; I don’t have any ‘12’ in my whole
project.&amp;nbsp; What does this error REALLY
mean?&amp;nbsp; What am I doing wrong?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Thanks!&lt;/p&gt;
&lt;p&gt;Ryan---&lt;/p&gt;</description></item><item><title>SQL Query Help</title><link>http://forums.asp.net/thread/3527838.aspx</link><pubDate>Mon, 23 Nov 2009 12:49:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3527838</guid><dc:creator>Zamma</dc:creator><author>Zamma</author><slash:comments>12</slash:comments><comments>http://forums.asp.net/thread/3527838.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3527838</wfw:commentRss><description>&lt;p&gt;Site Code: ASP.Net (2.0)&lt;/p&gt;
&lt;p&gt;Language: VB&lt;/p&gt;
&lt;p&gt;Database: MS Access (2003)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Not sure if this&amp;nbsp;is the best place to post but will give it a&amp;nbsp;try anyway&amp;nbsp;as the folks&amp;nbsp;here seem to be very helpful, even if it just to point me in the direction of another forum.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have a DataGrid which is showing information queried from a collection of tables referenced by one main table.&amp;nbsp;The initial query works great and populates the DataGrid. I then have two DropDownLists which are used to select &amp;#39;Active/Disabled&amp;#39; and &amp;#39;All/Female/Male/Unisex&amp;#39; for filtering the data that is pulled in the query. The Active/Disable one works without problems but when I try to filter on Gender I am having issues. I pressume this is because the gender is stored in one of the referenced tables. This is the query:&lt;/p&gt;&lt;pre class="vb.net" name="code"&gt;sComm = &amp;quot;SELECT &amp;quot;
        sComm = sComm &amp;amp; &amp;quot;tbl_product.product_id,&amp;quot;
        sComm = sComm &amp;amp; &amp;quot;(SELECT tbl_model.model_name FROM tbl_model WHERE tbl_model.model_id=tbl_product.model) As model,&amp;quot;
        sComm = sComm &amp;amp; &amp;quot;(SELECT tbl_frame.frame_name FROM tbl_frame WHERE tbl_frame.frame_id=tbl_product.frame) As frame,&amp;quot;
        sComm = sComm &amp;amp; &amp;quot;(SELECT tbl_lens.lens_name FROM tbl_lens WHERE tbl_lens.lens_id=tbl_product.lens) As lens,&amp;quot;
        sComm = sComm &amp;amp; &amp;quot;(SELECT tbl_model.gender FROM tbl_model WHERE tbl_model.model_id=tbl_product.model) As gender,&amp;quot;
        sComm = sComm &amp;amp; &amp;quot;(SELECT tbl_model.extras FROM tbl_model WHERE tbl_model.model_id=tbl_product.model) As extras &amp;quot;
        sComm = sComm &amp;amp; &amp;quot;FROM tbl_product &amp;quot;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For clarification:&lt;/p&gt;
&lt;p&gt;tbl_product is made up of references to the primary keys of 3 tables - tbl_model, table_frame and tbl_lens.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What I need to know is how to filter this query on gender. I thought a simple WHERE gender=&amp;#39;Male&amp;#39; would do it but it doesn&amp;#39;t seem to like this. Maybe a Join of some sort is needed?&lt;/p&gt;</description></item><item><title>Insert into Access from connection string in aspx.vb page</title><link>http://forums.asp.net/thread/3518462.aspx</link><pubDate>Tue, 17 Nov 2009 21:09:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3518462</guid><dc:creator>geo0071</dc:creator><author>geo0071</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3518462.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3518462</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am hoping someone can help me here.&amp;nbsp; I&amp;nbsp;am trying to insert into an Access database using a connection&amp;nbsp;string&amp;nbsp;from the web.config file.&amp;nbsp; I am trying to&amp;nbsp;do this&amp;nbsp;in a&amp;nbsp;code behind&amp;nbsp;page (aspx.vb).&amp;nbsp; Here is an example, any suggestions&amp;nbsp;are much appreciated.&amp;nbsp; I know my web.config is set correctly, because I am able to use the connection string using the grid control.&amp;nbsp; Here is a sample of the code.&amp;nbsp; Thanks again.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim connectionstring As New ConnectionStringsSection&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConnectionString = &amp;quot;&amp;lt;%$ ConnectionStrings:BankingConnectionString %&amp;gt;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProviderName = &amp;quot;&amp;lt;%$ ConnectionStrings:BankingConnectionString.ProviderName %&amp;gt;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim conn As New OleDb.OleDbConnection(&amp;quot;Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\banking.mdb&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sql As String = &amp;quot;INSERT INTO customer_data (ssn, fname, lname) VALUES (@tbSSN, @tbFname, @tbLname)&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim cmd As New OleDb.OleDbCommand(sql, conn)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.AddWithValue(&amp;quot;@tbSSN&amp;quot;, tbSSN.Text)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.AddWithValue(&amp;quot;@FirstName&amp;quot;, tbFname.Text)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.AddWithValue(&amp;quot;@LastName&amp;quot;, tbLname.Text)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; conn.Open()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.ExecuteNonQuery()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Dispose()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; conn.Close()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblMessage.Text = (&amp;quot;Thanks!&amp;nbsp; We have created a record for the SSN of &amp;quot; + tbSSN.Text)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tbSSN.Text = &amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;</description></item><item><title>Access date time function cannot be searched</title><link>http://forums.asp.net/thread/3525626.aspx</link><pubDate>Sat, 21 Nov 2009 15:02:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3525626</guid><dc:creator>Fliz</dc:creator><author>Fliz</author><slash:comments>5</slash:comments><comments>http://forums.asp.net/thread/3525626.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3525626</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;In my database I use the date/time fuction but I need to be able to search with the date as a parameter, but I have to specify it as a type which throws a data mismatch error.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:ControlParameter ControlID=&amp;quot;ODate&amp;quot; DefaultValue=&amp;quot;%%&amp;quot; Name=&amp;quot;OrderDate&amp;quot; PropertyName=&amp;quot;Text&amp;quot; Type=&amp;nbsp;&amp;nbsp;&amp;quot;DateTime&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;is there a specific type to use to get it to work? Or do I have to do something more complex?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;</description></item><item><title>How to do the same as SQL but with access db</title><link>http://forums.asp.net/thread/3524517.aspx</link><pubDate>Fri, 20 Nov 2009 18:04:14 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3524517</guid><dc:creator>cubangt</dc:creator><author>cubangt</author><slash:comments>4</slash:comments><comments>http://forums.asp.net/thread/3524517.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3524517</wfw:commentRss><description>&lt;p&gt;I have a few applications that connect to SQL.. so my connections and inserts are&amp;nbsp;done within the code behind. I then have some older apps&amp;nbsp;that are still updating and inserting into Access. how can i accomplish the same thing as seen below but for Access?&amp;nbsp;&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;        using (SqlConnection conn = new SqlConnection(this.connDB))
        using (SqlCommand cmd = new SqlCommand())
        {
            conn.Open();
            cmd.Connection = conn;
            cmd.CommandText = &amp;quot;emp_insert_new_hire&amp;quot;;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Clear();
&lt;/pre&gt;&lt;pre class="c-sharp" name="code"&gt;            cmd.Parameters.AddWithValue(&amp;quot;@dob&amp;quot;, txtbirth.Text.ToString());
            cmd.Parameters.AddWithValue(&amp;quot;@gen&amp;quot;, gen.SelectedValue.ToString());
            cmd.Parameters.AddWithValue(&amp;quot;@comby&amp;quot;, User.Identity.Name.ToString().Split(&amp;#39;\\&amp;#39;)[1]);
            cmd.Parameters.AddWithValue(&amp;quot;@eth&amp;quot;, eth.SelectedValue.ToString());
            cmd.ExecuteNonQuery();
        }&lt;/pre&gt;</description></item><item><title>Syntax error in UPDATE statement.</title><link>http://forums.asp.net/thread/1582380.aspx</link><pubDate>Fri, 16 Feb 2007 17:24:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1582380</guid><dc:creator>I-Weedy</dc:creator><author>I-Weedy</author><slash:comments>10</slash:comments><comments>http://forums.asp.net/thread/1582380.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=1582380</wfw:commentRss><description>&lt;font color=#0000ff size=2&gt;
&lt;p&gt;&amp;nbsp;Can anybody help me ?&lt;/p&gt;
&lt;p&gt;Fo the past few days i have been trying to create an edit, update delete datalist form however I have consistently been met with a syntax error in UPDATE statement.&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;I have tried various update statements and am still met with the same error! Can somebody stop me from going mad?&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;&lt;/font&gt;&lt;/p&gt;&amp;nbsp; 
&lt;p&gt;Imports&lt;font size=2&gt; System&lt;/font&gt;&lt;/p&gt;&lt;font color=#0000ff size=2&gt;
&lt;p&gt;Imports&lt;/p&gt;&lt;/font&gt;&lt;font size=2&gt; System.Data&lt;/font&gt;&lt;font color=#0000ff size=2&gt;
&lt;p&gt;Imports&lt;/p&gt;&lt;/font&gt;&lt;font size=2&gt; System.Data.OleDb&lt;/font&gt;&lt;font color=#0000ff size=2&gt;
&lt;p&gt;Partial&lt;/p&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;&lt;font size=2&gt; aspx_pages_admin_adminLatestNews
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Inherits&lt;/font&gt;&lt;font size=2&gt; System.Web.UI.Page
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Private&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; Page_Load(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; System.Object, _
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; System.EventArgs) _
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Handles&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;MyBase&lt;/font&gt;&lt;font size=2&gt;.Load
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'Put user code to initialize the page here&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Not&lt;/font&gt;&lt;font size=2&gt; IsPostBack &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Then&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;LoadData()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Public&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; LoadData()
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; ds = &lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; DataSet
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; conn &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbConnection(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Inetpub/wwwroot/test.mdb;"&lt;/font&gt;&lt;font size=2&gt;)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; OleDbDataAdapter1 = &lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbDataAdapter(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"SELECT * FROM test"&lt;/font&gt;&lt;font size=2&gt;, conn)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'Try&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;conn.Open()&lt;/p&gt;
&lt;p&gt;OleDbDataAdapter1.Fill(ds, &lt;/p&gt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;"titles_record"&lt;/font&gt;&lt;font size=2&gt;)
&lt;p&gt;conn.Close()&lt;/p&gt;
&lt;p&gt;DataList1.DataSource = ds&lt;/p&gt;
&lt;p&gt;DataList1.DataBind()&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;/p&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; Edit_Command(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Object&lt;/font&gt;&lt;font size=2&gt;, _
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; DataListCommandEventArgs)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;' to rebind the DataList to the data source to &lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;' refresh the control.&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;DataList1.EditItemIndex = e.Item.ItemIndex&lt;/p&gt;
&lt;p&gt;LoadData()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; Cancel_Command(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Object&lt;/font&gt;&lt;font size=2&gt;, _
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; DataListCommandEventArgs)
&lt;p&gt;DataList1.EditItemIndex = -1&lt;/p&gt;
&lt;p&gt;LoadData()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; Update_Command(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Object&lt;/font&gt;&lt;font size=2&gt;, _
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; DataListCommandEventArgs)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; tbox &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; TextBox
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; myID, myTitle, myArticle, myImage, myArticleDesc, myAuthor, myDateNews &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;String
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---retrieves the key for the row---&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;myID = DataList1.DataKeys(e.Item.ItemIndex)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---find the textbox control containing the Title&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;tbox = &lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;CType&lt;/font&gt;&lt;font size=2&gt;(e.Item.FindControl(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"txtTitle"&lt;/font&gt;&lt;font size=2&gt;), TextBox)
&lt;p&gt;myTitle = tbox.Text&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---find the textbox control containing the Article&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;tbox = &lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;CType&lt;/font&gt;&lt;font size=2&gt;(e.Item.FindControl(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"txtArticle"&lt;/font&gt;&lt;font size=2&gt;), TextBox)
&lt;p&gt;myArticle = tbox.Text&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---find the textbox control containing the Image&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;tbox = &lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;CType&lt;/font&gt;&lt;font size=2&gt;(e.Item.FindControl(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"txtImage"&lt;/font&gt;&lt;font size=2&gt;), TextBox)
&lt;p&gt;myImage = tbox.Text&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---find the textbox control containing the ArticleDesc&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;tbox = &lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;CType&lt;/font&gt;&lt;font size=2&gt;(e.Item.FindControl(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"txtArticleDesc"&lt;/font&gt;&lt;font size=2&gt;), TextBox)
&lt;p&gt;myArticleDesc = tbox.Text&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---find the textbox control containing the Author&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;tbox = &lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;CType&lt;/font&gt;&lt;font size=2&gt;(e.Item.FindControl(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"txtAuthor"&lt;/font&gt;&lt;font size=2&gt;), TextBox)
&lt;p&gt;myAuthor = tbox.Text&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---find the textbox control containing the DateNews&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;tbox = &lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;CType&lt;/font&gt;&lt;font size=2&gt;(e.Item.FindControl(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"txtDateNews"&lt;/font&gt;&lt;font size=2&gt;), TextBox)
&lt;p&gt;myDateNews = tbox.Text&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---updates the database---&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; myUpdate &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;String&lt;/font&gt;&lt;font size=2&gt; = &lt;/font&gt;&lt;font color=#800000 size=2&gt;"UPDATE&amp;nbsp;test SET (Title, Article, Image, ArticleDesc, Author, DateNews)VALUES(@Title, @Article, @Image, @ArticleDesc, @Author, @DateNews)"&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; conn &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbConnection(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Inetpub/wwwroot/test.mdb;"&lt;/font&gt;&lt;font size=2&gt;)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; comm &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; OleDbCommand = &lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbCommand(myUpdate, conn)
&lt;p&gt;comm.Parameters.Add(&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbParameter(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"@Title"&lt;/font&gt;&lt;font size=2&gt;, myTitle))
&lt;p&gt;comm.Parameters.Add(&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbParameter(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"@number"&lt;/font&gt;&lt;font size=2&gt;, myArticle))
&lt;p&gt;comm.Parameters.Add(&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbParameter(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"@nameID"&lt;/font&gt;&lt;font size=2&gt;, myImage))
&lt;p&gt;comm.Parameters.Add(&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbParameter(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"@name"&lt;/font&gt;&lt;font size=2&gt;, myArticleDesc))
&lt;p&gt;comm.Parameters.Add(&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbParameter(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"@number"&lt;/font&gt;&lt;font size=2&gt;, myAuthor))
&lt;p&gt;comm.Parameters.Add(&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; OleDbParameter(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"@nameID"&lt;/font&gt;&lt;font size=2&gt;, myDateNews))
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Try&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;conn.Open()&lt;/p&gt;
&lt;p&gt;comm.ExecuteNonQuery()&lt;/p&gt;
&lt;p&gt;conn.Close()&lt;/p&gt;
&lt;p&gt;DataList1.EditItemIndex = -1&lt;/p&gt;
&lt;p&gt;LoadData()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Catch&lt;/font&gt;&lt;font size=2&gt; ex &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; Exception
&lt;p&gt;Label1.Text = ex.Message &lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'Write error message&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Exit&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Try&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Try&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; Delete_Command(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Object&lt;/font&gt;&lt;font size=2&gt;, _
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; DataListCommandEventArgs)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---retrieves the key for the row---&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;Response.Write(DataList1.DataKeys(e.Item.ItemIndex))&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'---codes to delete row here----&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;'-------------------------------&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;&amp;nbsp;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;
&lt;p&gt;End&lt;/p&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;</description></item><item><title>Errors when trying to upsize ms access database to ms sql</title><link>http://forums.asp.net/thread/3520507.aspx</link><pubDate>Wed, 18 Nov 2009 21:13:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3520507</guid><dc:creator>mausimo</dc:creator><author>mausimo</author><slash:comments>6</slash:comments><comments>http://forums.asp.net/thread/3520507.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3520507</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am trying to upsize a existing ms access database to a sql database. The reason why i am doing this is because i know how to&amp;nbsp;use ms sql no problem, where as&amp;nbsp;ms access is so different i can not even figure out how to write queries....&lt;/p&gt;
&lt;p&gt;When upsizing to sql server&amp;nbsp;using the wizard: &amp;nbsp;&amp;nbsp;Use existing database option &amp;gt;&amp;gt; next button gives me the following error - ODBC --call failed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When upsizing to sql server using the wizard:&amp;nbsp;&amp;nbsp;Create New Database option &amp;gt;&amp;gt; next button &amp;gt;&amp;gt; (on the next wizard screen:) if i use Database: (local) and have use Trusted Connection checked i get the error - ODBC connection to &amp;#39;sql Server(local)&amp;#39; failed.&lt;/p&gt;
&lt;p&gt;Does anyone know what is going wrong or what i am doing wrong?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;-Mike&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Noob learning about forms.</title><link>http://forums.asp.net/thread/3520227.aspx</link><pubDate>Wed, 18 Nov 2009 17:40:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3520227</guid><dc:creator>FreeFromTheSouth</dc:creator><author>FreeFromTheSouth</author><slash:comments>5</slash:comments><comments>http://forums.asp.net/thread/3520227.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3520227</wfw:commentRss><description>&lt;p&gt;I have a access datasource with a simple listbox that when the record is selected it postback a different column from the record&amp;#39;s data on the existing label.&lt;/p&gt;&lt;p&gt;If I add another Label and I want to get another column from thet recortd to postback in the label as well what do I do to this codebehind to make it work?&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Free&lt;/p&gt;&lt;p&gt;Codebehind&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-------------------------------------------------------&lt;/p&gt;&lt;p&gt;using System;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Xml.Linq;&lt;br /&gt;&lt;br /&gt;public partial class DataBind : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!this.IsPostBack)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.ListBox1.DataSource = this.AccessDataSource1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.ListBox1.DataTextField = &amp;quot;AuthorLastName&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.ListBox1.DataValueField = &amp;quot;Title&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.ListBox1.DataBind();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Label1.Text = ListBox1.SelectedItem.Value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;-------------------------------------------------------&lt;/p&gt;&lt;p&gt;ASPX Code&lt;/p&gt;&lt;p&gt;-------------------------------------------------------&lt;/p&gt;&lt;p&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;DataBind.aspx.cs&amp;quot; Inherits=&amp;quot;DataBind&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .style1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 250px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:AccessDataSource ID=&amp;quot;AccessDataSource1&amp;quot; runat=&amp;quot;server&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataFile=&amp;quot;~/App_Data/ASPDotNetStepByStep.mdb&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SelectCommand=&amp;quot;SELECT * FROM [DotNetReferences]&amp;quot;&amp;gt;&amp;lt;/asp:AccessDataSource&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;table align=&amp;quot;left&amp;quot; style=&amp;quot;height: 186px; width: 271px&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ListBox ID=&amp;quot;ListBox1&amp;quot; runat=&amp;quot;server&amp;quot; AutoPostBack=&amp;quot;True&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onselectedindexchanged=&amp;quot;ListBox1_SelectedIndexChanged&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataTextField=&amp;quot;ID&amp;quot; DataValueField=&amp;quot;Title&amp;quot; Width=&amp;quot;181px&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Label ID=&amp;quot;Label1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;nbsp; Text=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/table&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;</description></item><item><title>To change SQL script to Access</title><link>http://forums.asp.net/thread/3517566.aspx</link><pubDate>Tue, 17 Nov 2009 12:45:28 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3517566</guid><dc:creator>Oskar92</dc:creator><author>Oskar92</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3517566.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3517566</wfw:commentRss><description>&lt;p&gt;Hi&amp;nbsp;i need to change alot of&amp;nbsp;SQL coding to work with an Microsoft Access&amp;nbsp;Database, was hoping that some blessed soul&amp;nbsp;could write&amp;nbsp;the whole code for me. It an script to an Calandar. &lt;/p&gt;
&lt;p&gt;The link:http://aspnet.4guysfromrolla.com/articles/041603-1.2.aspx&lt;/p&gt;
&lt;p&gt;At the buttom under attachment Download the complete source code (in zip-format)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Oskar&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Any release of 64 Bit Jet drivers on the horizon?</title><link>http://forums.asp.net/thread/3410376.aspx</link><pubDate>Thu, 17 Sep 2009 10:34:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3410376</guid><dc:creator>MartijnG</dc:creator><author>MartijnG</author><slash:comments>5</slash:comments><comments>http://forums.asp.net/thread/3410376.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3410376</wfw:commentRss><description>&lt;p&gt;Can any of the Microsoft people comment if any 64 Bit Jet drivers will be developed?&lt;/p&gt;
&lt;p&gt;I’m working on a large web application that runs in 64 bit with a big database backend but one small part of the application requires the ability to connect to some Access databases using oledb.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At the moment I’ve dropped the whole app down to 32 bit to make it work but it was faster on 64 bit. Unless there is any intention of MS developing 64 bit Jet Driver then I may queue these reporting &amp;amp; data manipulation processes using Access and run then from a backend windows console application and push the end report to the web interface for download on completion. Choices, choices.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks for any feedback,&lt;/p&gt;
&lt;p&gt;M &lt;img title="Smile" border="0" alt="Smile" src="http://forums.asp.net/tiny_mce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif" /&gt;&lt;/p&gt;</description></item><item><title>Access Database access fail</title><link>http://forums.asp.net/thread/3515731.aspx</link><pubDate>Mon, 16 Nov 2009 16:11:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3515731</guid><dc:creator>bryanfok</dc:creator><author>bryanfok</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3515731.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3515731</wfw:commentRss><description>&lt;p&gt;Hi all&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My application&amp;nbsp;has driven me crazy. It works fine at my home deve&amp;nbsp;machine , it works fine in my work dev machine, and it works fine in my work local server. But when i deploy to live (a new server), it crashed!!!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It can display my login page, but when i tried to login, it couldnt connect to my access database. my access database is at C:\wwwroot\TUV_MGB_PROJECT_MANAGEMENT\App_Data\ASPNetDB.mdb&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Error:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; 
&lt;h1&gt;Server Error in &amp;#39;/&amp;#39; Application. 
&lt;hr /&gt;
&lt;/h1&gt;
&lt;h2&gt;&lt;i&gt;AccessFile is not valid: C:\wwwroot\TUV_MGB_PROJECT_MANAGEMENT\Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\wwwroot\TUV_MGB_PROJECT_MANAGEMENT\App_Data\ASPNetDB.mdb;Jet OLEDB:Database Password=Stx4alyz;&lt;/i&gt; &lt;/h2&gt;&lt;/span&gt;&lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&gt;&lt;b&gt;Description: &lt;/b&gt;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. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Exception Details: &lt;/b&gt;System.Exception: AccessFile is not valid: C:\wwwroot\TUV_MGB_PROJECT_MANAGEMENT\Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\wwwroot\TUV_MGB_PROJECT_MANAGEMENT\App_Data\ASPNetDB.mdb;Jet OLEDB:Database Password=Stx4alyz;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Source Error:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;code&gt;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.&lt;/code&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;b&gt;Stack Trace:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&lt;pre&gt;[Exception: AccessFile is not valid: C:\wwwroot\TUV_MGB_PROJECT_MANAGEMENT\Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\wwwroot\TUV_MGB_PROJECT_MANAGEMENT\App_Data\ASPNetDB.mdb;Jet OLEDB:Database Password=Stx4alyz;]
   Samples.AccessProviders.AccessConnectionHelper.EnsureValidMdbFile(String fileName) in C:\Documents and Settings\fokbr\My Documents\Visual Studio 2008\Projects\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT\Samples\AccessProviders\AccessConnectionHelper.cs:291
   Samples.AccessProviders.AccessConnectionHelper.BuildConnectionForFileName(String dbFileName) in C:\Documents and Settings\fokbr\My Documents\Visual Studio 2008\Projects\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT\Samples\AccessProviders\AccessConnectionHelper.cs:95
   Samples.AccessProviders.AccessConnectionHelper.GetConnection(String dbFileName, Boolean revertImpersonation) in C:\Documents and Settings\fokbr\My Documents\Visual Studio 2008\Projects\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT\Samples\AccessProviders\AccessConnectionHelper.cs:152
   Samples.AccessProviders.AccessRoleProvider.IsUserInRole(String username, String roleName) in C:\Documents and Settings\fokbr\My Documents\Visual Studio 2008\Projects\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT\Samples\AccessProviders\AccessRoleProvider.cs:98
   System.Web.Security.Roles.IsUserInRole(String username, String roleName) +607
   TUV_MGB_PROJECT_MANAGEMENT.Login.LoginButton_Click(Object sender, EventArgs e) in C:\Documents and Settings\fokbr\My Documents\Visual Studio 2008\Projects\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT_V2\TUV_MGB_PROJECT_MANAGEMENT\Login.aspx.cs:45
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981
&lt;/pre&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is my connection string in web.config.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;connectionStrings&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;add name=&amp;quot;AccessdbConn&amp;quot; connectionString=&amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\wwwroot\TUV_MGB_PROJECT_MANAGEMENT\App_Data\ASPNetDB.mdb;Jet OLEDB:Database Password=Stx4alyz;&amp;quot; providerName=&amp;quot;System.Data.OleDb&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;!--&amp;lt;add name=&amp;quot;ASPNetDBConnectionString&amp;quot; connectionString=&amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\ASPNetDB.mdb;Persist Security Info=True&amp;quot; providerName=&amp;quot;System.Data.OleDb&amp;quot; /&amp;gt;--&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/connectionStrings&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can someone help me solve this please.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Bryan&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>"LIKE" QUERY execution through C# code</title><link>http://forums.asp.net/thread/3517099.aspx</link><pubDate>Tue, 17 Nov 2009 08:54:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3517099</guid><dc:creator>ranacseruet</dc:creator><author>ranacseruet</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3517099.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3517099</wfw:commentRss><description>&lt;p&gt;I am trying to execute&amp;nbsp; access query that search a table. I am using -----&amp;nbsp; LIKE &amp;#39;a*&amp;#39;&amp;nbsp; -------- sytax. this is executing correctly when i am running on database. but when i am executing through asp.net/c# using enterprise library, returned dataset&amp;#39;s table has 0 rows. Why is this? Can anyone give me the solution?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Regards&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Select Statement Today/Now syntax</title><link>http://forums.asp.net/thread/3515523.aspx</link><pubDate>Mon, 16 Nov 2009 14:36:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3515523</guid><dc:creator>TRU</dc:creator><author>TRU</author><slash:comments>7</slash:comments><comments>http://forums.asp.net/thread/3515523.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3515523</wfw:commentRss><description>&lt;p&gt;Below is my select statement for an events list.&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;
&lt;p&gt;SelectCommand&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;SELECT * FROM [hdEvents] ORDER BY [eventsDate]&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;I would like to modify this statement so that expired dates do not display.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;So, something like Where eventsdate is &amp;gt;= Today or Now.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;What is the proper syntax to make this happen.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;Thanks,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;TRU&lt;/font&gt;&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>access data from multiple tables in vwd2008</title><link>http://forums.asp.net/thread/3515308.aspx</link><pubDate>Mon, 16 Nov 2009 12:54:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3515308</guid><dc:creator>tracy6001</dc:creator><author>tracy6001</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3515308.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3515308</wfw:commentRss><description>&lt;p&gt;hello,&lt;/p&gt;
&lt;p&gt;i am trying to get data from two tables named &amp;quot;ofotentry,fabotentry&amp;quot;&lt;/p&gt;
&lt;p&gt;using two text boxes in my form in which i am giving two dates ...acoording to that date range i need name,date and total hrs fields from the two tables...&lt;/p&gt;
&lt;p&gt;my asp.net coding is like this&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;SELECT fabotentry.Name, fabotentry.[Date], fabotentry.TotalHrs, ofotentry.Name1 AS Expr1, ofotentry.[Date1] AS Expr2, ofotentry.TotalHrs1 AS Expr3 FROM fabotentry, ofotentry WHERE (fabotentry.[Date] &amp;amp;lt;= ?) AND (fabotentry.[Date] &amp;amp;gt;= ?) AND (ofotentry.[Date1] &amp;amp;lt;= ?) AND (ofotentry.[Date1] &amp;amp;gt;= ?)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;my vb.net coding is like this&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;Dim dataset1 As New DataSet()&lt;br /&gt;&amp;nbsp;Try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim con As OleDbConnection&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim cmd As OleDbCommand&lt;br /&gt;con = New OleDbConnection(&amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator.HOME\My Documents\Visual Studio 2008\WebSites\production\otentry.mdb;&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sqlstring As String = &amp;quot;select Name,Date,TotalHrs,Name1,Date1,TotalHrs1 from fabotentry,ofotentry where Date between &amp;#39;&amp;quot; &amp;amp; tb1.Text &amp;amp; &amp;quot;&amp;#39; and &amp;#39;&amp;quot; &amp;amp; tb2.Text &amp;amp; &amp;quot;&amp;#39;&amp;quot;&lt;br /&gt;&amp;nbsp; cmd = New OleDbCommand(sqlstring, con)&lt;br /&gt;Dim oledbdataadapter1 As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(sqlstring, con)&lt;br /&gt;con.Open()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oledbdataadapter1.Fill(dataset1, &amp;quot;ofotentry&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oledbdataadapter1.Fill(dataset2, &amp;quot;fabotentry&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataSource = dataset1.Tables(&amp;quot;ofotentry&amp;quot;, &amp;quot;fabotentry&amp;quot;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataBind()&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con.Close()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;MY PROBLEM IS &amp;quot;NOTHING DISPLAYED&amp;quot; FOR THIS QUERY&lt;/p&gt;
&lt;p&gt;WHAT TO DO???&lt;/p&gt;
&lt;p&gt;THANKS&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Trouble getting table to update and delete</title><link>http://forums.asp.net/thread/3515283.aspx</link><pubDate>Mon, 16 Nov 2009 12:39:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3515283</guid><dc:creator>Fliz</dc:creator><author>Fliz</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3515283.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3515283</wfw:commentRss><description>&lt;p&gt;I am trying to get a table to update and delete from a asp.net page (VB)&amp;nbsp;but when the page loads, no tables or anything appear&amp;nbsp;to allow&amp;nbsp; this to take place. Is there a problem with my sql? or is it something else?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;%@ Page&amp;nbsp; Explicit=&amp;quot;True&amp;quot; Language=&amp;quot;VB&amp;quot; MasterPageFile=&amp;quot;main.master&amp;quot; Debug=&amp;quot;True&amp;quot; %&amp;gt;&lt;br /&gt;&amp;lt;%@ Import Namespace=&amp;quot;System.Data&amp;quot; %&amp;gt;&lt;br /&gt;&amp;lt;%@ Import Namespace=&amp;quot;Syetm.Data.OleDb&amp;quot; %&amp;gt;&lt;br /&gt;&amp;lt;asp:content id=&amp;quot;script&amp;quot; ContentPlaceHolderID=&amp;quot;script&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Sub DetailsView_ItemUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdatedEventArgs)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect(&amp;quot;customers.aspx&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Sub DetailsView_ItemDeleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewDeletedEventArgs)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect(&amp;quot;customers.aspx&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Sub DetailsView_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewCommandEventArgs)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If e.CommandName = &amp;quot;Cancel&amp;quot; Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect(&amp;quot;customers.aspx&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/asp:content&amp;gt;&lt;br /&gt;&amp;lt;asp:content id=&amp;quot;Title&amp;quot; ContentPlaceHolderID=&amp;quot;Title&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;DVD-Wonders Customers&amp;lt;/asp:content&amp;gt;&lt;br /&gt;&amp;lt;asp:content id=&amp;quot;Header&amp;quot; ContentPlaceHolderID=&amp;quot;Header&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Edit Customer Table&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;/asp:content&amp;gt;&lt;br /&gt;&amp;lt;asp:content id=&amp;quot;PageBody&amp;quot; ContentPlaceHolderID=&amp;quot;PageBody&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;To make changes to the customer table click Edit, make the changes, then click Update. To Delete a record , click the Delete button.&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;asp:DetailsView ID=&amp;quot;DetailsView&amp;quot; runat=&amp;quot;server&amp;quot; Height=&amp;quot;50px&amp;quot; Width=&amp;quot;100%&amp;quot; AutoGenerateRows=&amp;quot;False&amp;quot; DataKeyNames=&amp;quot;CustomerID&amp;quot; DataSourceID=&amp;quot;SqlDataSource1&amp;quot; ForeColor=&amp;quot;#FFFFFF&amp;quot; BorderColor=&amp;quot;#0000CC&amp;quot; CellPadding=&amp;quot;2&amp;quot; OnItemUpdated=&amp;quot;DetailsView_ItemUpdated&amp;quot; OnItemDeleted=&amp;quot;DetailsView_ItemDeleted&amp;quot; OnItemCommand=&amp;quot;DetailsView_ItemCommand&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;Fields&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;asp:BoundField DataField=&amp;quot;CustomerID&amp;quot; HeaderText=&amp;quot;Customer ID&amp;quot; SortExpression=&amp;quot;CustomerID&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerTitle&amp;quot; HeaderText=&amp;quot;Customer Title&amp;quot; SortExpression=&amp;quot;CustomerTitle&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;asp:BoundField DataField=&amp;quot;CustomerFName&amp;quot; HeaderText=&amp;quot;Customer First Name&amp;quot; SortExpression=&amp;quot;CustomerFName&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerSName&amp;quot; HeaderText=&amp;quot;Customer Surname&amp;quot; SortExpression=&amp;quot;CustomerSName&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerAddress1&amp;quot; HeaderText=&amp;quot;Customer Address 1&amp;quot; SortExpression=&amp;quot;CustomerAddress1&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerAddress2&amp;quot; HeaderText=&amp;quot;Customer Address 2&amp;quot; SortExpression=&amp;quot;CustomerAddress2&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerAddress3&amp;quot; HeaderText=&amp;quot;Customer Address 3&amp;quot; SortExpression=&amp;quot;CustomerAddress3&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerPostcode&amp;quot; HeaderText=&amp;quot;Customer Postcode&amp;quot; SortExpression=&amp;quot;CustomerPostcode&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerCounty&amp;quot; HeaderText=&amp;quot;Customer County&amp;quot; SortExpression=&amp;quot;CustomerCounty&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerPhoneNo&amp;quot; HeaderText=&amp;quot;Customer Phone No&amp;quot; SortExpression=&amp;quot;CustomerPhoneNo&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerMobile&amp;quot; HeaderText=&amp;quot;Customer Mobile&amp;quot; SortExpression=&amp;quot;CustomerMobile&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField=&amp;quot;CustomerEmail&amp;quot; HeaderText=&amp;quot;Customer Email&amp;quot; SortExpression=&amp;quot;CustomerEmail&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;lt;asp:CommandField ButtonType=&amp;quot;Button&amp;quot; ShowDeleteButton=&amp;quot;True&amp;quot; ShowEditButton=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/Fields&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RowStyle BackColor=&amp;quot;#FFFFFF&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FieldHeaderStyle BackColor=&amp;quot;#FFFFFF&amp;quot; Font-Bold=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/asp:DetailsView&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:SqlDataSource ID=&amp;quot;SqlDataSource1&amp;quot; runat=&amp;quot;server&amp;quot; ConflictDetection=&amp;quot;CompareAllValues&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConnectionString=&amp;quot;&amp;lt;%$ ConnectionStrings:DVDConnectString %&amp;gt;&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;DeleteCommand=&amp;quot;DELETE FROM [Customers] WHERE [CustomerID] = ? AND [CustomerTitle] = ? AND [CustomerFName] = ? AND [CustomerSName] = ? AND [CustomerAddress1] = ? AND [CustomerAddress2] = ? AND [CustomerAddress3] = ? AND [CustomerPostcode] = ? AND [CustomerCounty] = ? AND [CustomerPhoneNo] = ? AND [CustomerMobile] = ? AND [CustomerEmail] = ?&amp;quot; ProviderName=&amp;quot;&amp;lt;%$ ConnectionStrings:DVDConnectString.ProviderName %&amp;gt;&amp;quot; SelectCommand=&amp;quot;SELECT [CustomerID], [CustomerTitle], [CustomerFName], [CustomerSName], [CustomerAddress1], [CustomerAddress2], [CustomerAddress3], [CustomerPostcode], [CustomerCounty], [CustomerPhoneNo], [CustomerMobile], [CustomerEmail] FROM [Customers] WHERE ([CustomerID] = ?)&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UpdateCommand=&amp;quot;UPDATE [Customers] SET [CustomerID] = ?, [CustomerTitle] = ?, [CustomerFName] = ?, [CustomerSName] = ?, [CustomerAddress1] = ?, [CustomerAddress2] = ?, [CustomerAddress3] = ?, [CustomerPostcode] = ?, [CustomerCounty] = ?, [CustomerPhoneNo] = ?, [CustomerMobile] = ?, [CustomerMobile] WHERE [CustomerID] = ? AND [CustomerTitle] = ? AND [CustomerFName] = ? AND [CustomerSName] = ? AND [CustomerAddress1] = ? AND [CustomerAddress2] = ? AND [CustomerAddress3] = ? AND [CustomerPostcode] = ? AND [CustomerCounty] =? AND [CustomerPhoneNo] = ? AND [CustomerMobile] = ? AND [CustomerEmail] = ?&amp;quot;&amp;gt;&lt;br /&gt;&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DeleteParameters&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerID&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerTitle&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerFName&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerSName&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerAddress1&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerAddress2&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerAddress3&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerPostcode&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerCounty&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:Parameter Name=&amp;quot;CustomerPhoneNo&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerMobile&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerEmail&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DeleteParameters&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;UpdateParameters&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerID&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerTitle&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerFName&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerSName&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerAddress1&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerAddress2&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerAddress3&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerPostcode&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerCounty&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerPhoneNo&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerMobile&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Parameter Name=&amp;quot;CustomerEmail&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/UpdateParameters&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:SqlDataSource&amp;gt;&lt;br /&gt;&amp;lt;/asp:content&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>@@Identity - Accessdatasource return ID Inserted record </title><link>http://forums.asp.net/thread/3510623.aspx</link><pubDate>Fri, 13 Nov 2009 09:55:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3510623</guid><dc:creator>colinejarvis</dc:creator><author>colinejarvis</author><slash:comments>10</slash:comments><comments>http://forums.asp.net/thread/3510623.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3510623</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I hope someone can help solve the problem of returning the value of the unique key when inserting a new record into an access database.&amp;nbsp; I understand that if using an MSAccess database then @@Identity needs to be used.&amp;nbsp; Iam usining access2007 and also coding in C#.&lt;/p&gt;
&lt;p&gt;I have the following simple code to insert a contact name into Table1 with the unique key as Contactid which is set to autonumber in the MSAccess table:&lt;/p&gt;
&lt;p&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;ZZZ.aspx.cs&amp;quot; Inherits=&amp;quot;ZZZ&amp;quot; %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;function pageLoad() {&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/head&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;body&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:ScriptManager ID=&amp;quot;ScriptManager1&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:DetailsView ID=&amp;quot;DetailsView1&amp;quot; runat=&amp;quot;server&amp;quot; AutoGenerateRows=&amp;quot;False&amp;quot; &lt;/p&gt;
&lt;p&gt;DataKeyNames=&amp;quot;ContactID&amp;quot; DataSourceID=&amp;quot;AccessDataSource1&amp;quot; DefaultMode=&amp;quot;Insert&amp;quot; &lt;/p&gt;
&lt;p&gt;Height=&amp;quot;50px&amp;quot; Width=&amp;quot;125px&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Fields&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:BoundField DataField=&amp;quot;ContactID&amp;quot; HeaderText=&amp;quot;ContactID&amp;quot; &lt;/p&gt;
&lt;p&gt;InsertVisible=&amp;quot;False&amp;quot; ReadOnly=&amp;quot;True&amp;quot; SortExpression=&amp;quot;ContactID&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:BoundField DataField=&amp;quot;ContactName&amp;quot; HeaderText=&amp;quot;ContactName&amp;quot; &lt;/p&gt;
&lt;p&gt;SortExpression=&amp;quot;ContactName&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:CommandField ShowInsertButton=&amp;quot;True&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:TemplateField&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;InsertItemTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:Label ID=&amp;quot;Label1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;#39;&amp;lt;%# Eval(&amp;quot;ContactID&amp;quot;) %&amp;gt;&amp;#39;&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/InsertItemTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/asp:TemplateField&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Fields&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/asp:DetailsView&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:AccessDataSource ID=&amp;quot;AccessDataSource1&amp;quot; runat=&amp;quot;server&amp;quot; &lt;/p&gt;
&lt;p&gt;ConflictDetection=&amp;quot;CompareAllValues&amp;quot; DataFile=&amp;quot;~/App_Data/CRM.mdb&amp;quot; &lt;/p&gt;
&lt;p&gt;DeleteCommand=&amp;quot;DELETE FROM [Table1] WHERE [ContactID] = ? AND (([ContactName] = ?) OR ([ContactName] IS NULL AND ? IS NULL))&amp;quot; &lt;/p&gt;
&lt;p&gt;InsertCommand=&amp;quot;INSERT INTO [Table1] ([ContactName]) VALUES (?)&amp;quot; &lt;/p&gt;
&lt;p&gt;OldValuesParameterFormatString=&amp;quot;original_{0}&amp;quot; &lt;/p&gt;
&lt;p&gt;SelectCommand=&amp;quot;SELECT [ContactID], [ContactName] FROM [Table1]&amp;quot; &lt;/p&gt;
&lt;p&gt;UpdateCommand=&amp;quot;UPDATE [Table1] SET [ContactName] = ? WHERE [ContactID] = ? AND (([ContactName] = ?) OR ([ContactName] IS NULL AND ? IS NULL))&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;InsertParameters&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:Parameter Name=&amp;quot;ContactName&amp;quot; Type=&amp;quot;String&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/InsertParameters&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/asp:AccessDataSource&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/body&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;
&lt;p&gt;Code Behind:&lt;/p&gt;
&lt;p&gt;using System;&lt;/p&gt;
&lt;p&gt;using System.Collections.Generic;&lt;/p&gt;
&lt;p&gt;using System.Linq;&lt;/p&gt;
&lt;p&gt;using System.Web;&lt;/p&gt;
&lt;p&gt;using System.Web.UI;&lt;/p&gt;
&lt;p&gt;using System.Web.UI.WebControls;&lt;/p&gt;
&lt;p&gt;public partial class ZZZ : System.Web.UI.Page&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;protected void Page_Load(object sender, EventArgs e)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I also have a label1 which I would like to display the newly inserted record.&lt;/p&gt;
&lt;p&gt;I would be grateful if someone could spare me the time to adjust the code for this simple example to get the Contact ID Value.&lt;/p&gt;
&lt;p&gt;Many thanks in anticipation&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Colin&lt;/p&gt;</description></item><item><title>How do I make an identity field in Access?</title><link>http://forums.asp.net/thread/3513186.aspx</link><pubDate>Sun, 15 Nov 2009 01:36:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3513186</guid><dc:creator>sfskseg32</dc:creator><author>sfskseg32</author><slash:comments>4</slash:comments><comments>http://forums.asp.net/thread/3513186.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3513186</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am trying to create an insert option for my&amp;nbsp;page.&amp;nbsp; I am using &amp;nbsp;the details view control and a MS Access Database.&amp;nbsp; Currently I cannot insert anything because I don&amp;#39;t know how to handle the primary key insertion.&amp;nbsp; I saw on another page that I need it to be an identity field.&amp;nbsp; How do I make it one?&amp;nbsp; Also, my current non working insert string looks like this: &lt;/p&gt;
&lt;p&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;
&lt;p&gt;INSERT INTO [customers] ([ID], [employee], [firstname], [lastname], [cell], [home], [work], [payment], [status], [notes]) VALUES (?, &lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;?, ?, ?, ?, ?, ?, ?, ?, ?)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;where ID is the primary key.&amp;nbsp; Once I do make it an identity, would I just remove it from the insert string?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/p&gt;</description></item><item><title>inset into access database</title><link>http://forums.asp.net/thread/3512662.aspx</link><pubDate>Sat, 14 Nov 2009 13:22:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3512662</guid><dc:creator>lamish</dc:creator><author>lamish</author><slash:comments>5</slash:comments><comments>http://forums.asp.net/thread/3512662.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3512662</wfw:commentRss><description>&lt;p&gt;Hi guys!&lt;/p&gt;&lt;p&gt;OleDbConnection cn = new OleDbConnection(@&amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|db.mdb;Persist Security Info=False&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OleDbCommand cmd = new OleDbCommand(&amp;quot;INSERT INTO upload (aID, mID, bildnamn, datum) VALUES (&amp;#39;10&amp;#39;, &amp;#39;81&amp;#39;, &amp;#39;&amp;quot; + UploadControl1.FileName + &amp;quot;&amp;#39;, &amp;#39;&amp;quot; + Convert.ToString(DateTime.Now) + &amp;quot;&amp;#39;)&amp;quot;, cn);&lt;br /&gt;&lt;br /&gt;cmd.Connection.Open();&lt;br /&gt;cmd.ExecuteNonQuery();&lt;br /&gt;cmd.Connection.Close();&lt;/p&gt;&lt;p&gt;this is my code.&lt;/p&gt;&lt;p&gt;Whne i launch it nothing happens. i dont get any error. when i look at the database to see if something was inserted i notice that nothing was.&lt;/p&gt;&lt;p&gt;anyone seeing a error whit my code?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>SQL query: Inserting multiple results into a new table</title><link>http://forums.asp.net/thread/3511866.aspx</link><pubDate>Fri, 13 Nov 2009 20:54:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3511866</guid><dc:creator>lorengphd1</dc:creator><author>lorengphd1</author><slash:comments>1</slash:comments><comments>http://forums.asp.net/thread/3511866.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3511866</wfw:commentRss><description>&lt;p&gt;I have a MS ACCESS 2000 sql query that returns several results, sometimes up to 30 or so.&amp;nbsp; I want to insert these results into a new table all at once, each with their own unique ID [once in the new table].&amp;nbsp; How is this accomplished?&lt;/p&gt;&lt;p&gt;Thanks!&lt;/p&gt;&lt;p&gt;Loren&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Can LINQ use on Access database ? How ?</title><link>http://forums.asp.net/thread/3499723.aspx</link><pubDate>Sat, 07 Nov 2009 15:29:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3499723</guid><dc:creator>hkbeer</dc:creator><author>hkbeer</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3499723.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3499723</wfw:commentRss><description>&lt;p&gt;Can LINQ use on Access database ? How ?&lt;/p&gt;
&lt;p&gt;I read several books and no one touches on this.&lt;/p&gt;
&lt;p&gt;Pls help... Thanks&amp;nbsp;&lt;/p&gt;</description></item><item><title>Insert record from table1 into table2 using button click</title><link>http://forums.asp.net/thread/3508270.aspx</link><pubDate>Thu, 12 Nov 2009 09:11:43 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3508270</guid><dc:creator>hkbeer</dc:creator><author>hkbeer</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3508270.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3508270</wfw:commentRss><description>&lt;p&gt;Hi I have 2 tables, table 1 &amp;amp; table&amp;nbsp;2 in mdb file.&lt;/p&gt;
&lt;p&gt;I have standard append query called queryA contains : insert into table2 select * from table1.&lt;/p&gt;
&lt;p&gt;Now I want to make ASP.net page with a button onclick will&amp;nbsp;perform exactly what queryA above does.&lt;/p&gt;
&lt;p&gt;I tried adding&amp;nbsp;accessdatasource as follows:-&lt;/p&gt;
&lt;p&gt;Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccessDataSource1.DataBind()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.DataBind()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:AccessDataSource ID=&amp;quot;AccessDataSource1&amp;quot; runat=&amp;quot;server&amp;quot; DataFile=&amp;quot;~/Data.mdb&amp;quot; SelectCommand=&amp;quot;INSERT INTO table2 SELECT *&lt;br /&gt;FROM table1&amp;quot;&amp;gt;&amp;lt;/asp:AccessDataSource&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Button ID=&amp;quot;Button1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Button&amp;quot; onclick=&amp;quot;Button1_Click&amp;quot; /&amp;gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When button click, no record is appended.&lt;/p&gt;
&lt;p&gt;Even I modified to&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:AccessDataSource ID=&amp;quot;AccessDataSource1&amp;quot; runat=&amp;quot;server&amp;quot; DataFile=&amp;quot;~/Data.mdb&amp;quot; SelectCommand=&amp;quot;Select * from QueryA&amp;quot;&amp;gt;&amp;lt;/asp:AccessDataSource&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Button ID=&amp;quot;Button1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Button&amp;quot; onclick=&amp;quot;Button1_Click&amp;quot; /&amp;gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;No record is appended to Table2 again.&lt;/p&gt;
&lt;p&gt;What should I do to make that append happen ?&lt;/p&gt;
&lt;p&gt;Thannks&lt;/p&gt;</description></item><item><title>Using a datasource to insert a string</title><link>http://forums.asp.net/thread/3506031.aspx</link><pubDate>Wed, 11 Nov 2009 08:31:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3506031</guid><dc:creator>joshmariam</dc:creator><author>joshmariam</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3506031.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3506031</wfw:commentRss><description>&lt;p&gt;I have an access datasource and I want to take a string and input it into an access database. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;ve had some troubles doing this and I really haven&amp;#39;t found a solution. Can anyone tell me how to do this?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Reading xlsx file in C# using Microsoft.ACE.OLEDB returning blank value</title><link>http://forums.asp.net/thread/3501954.aspx</link><pubDate>Mon, 09 Nov 2009 13:00:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3501954</guid><dc:creator>bbenadict</dc:creator><author>bbenadict</author><slash:comments>1</slash:comments><comments>http://forums.asp.net/thread/3501954.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3501954</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I have to read an xlsx file in which there are multiple columns. One of it is a &amp;#39;Date&amp;#39; column type. I am using OLEDB with Microsoft.ACE.OLEDB.12.0 as the provider. The problem is, suppose if there is a non date value (Error data) in the column the oledb is replacing the error data with null. I have a requirement to show the all data (good data as well as the error) to user who is reading the excel file into our database.i.e. i dont wnt the engine to convert the value to null&lt;br /&gt;&lt;br /&gt;When reading xls file,which can be done by using Microsoft.Jet.4.0 provider, we can overcome this by changing property of IMEX=1 and changing the &amp;#39;Typeguessrows=1&amp;#39; in the registry. But unfortunately this provider cannot be used for reading an xlsx file.&lt;br /&gt;&lt;br /&gt;Can anyone help me how to overcome this problem??? I have also listed down the code below which i am using for reading the file&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="c-sharp"&gt;DataSet ds = new DataSet();
            //Provider String Extended properties:
            //&amp;quot;Excel 12.0&amp;quot;: Use Excel (xls or xlsx) as source
            //&amp;quot;Header Yes&amp;quot;: Header is included in the Excel sheet
            //&amp;quot;IMEX=1&amp;quot;: When reading from the excel sheet ignore datatypes and read all data in the sheet.
            //Without setting IMEX=0, the excel reader looks for the datatype in the excel sheet.
            //The code below in comments was used for reading xls file
            //OleDbConnection con = new OleDbConnection(@&amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&amp;quot; + FileName + &amp;quot;;Extended Properties=\&amp;quot;Excel 8.0;HDR=Yes;IMEX=1\&amp;quot;&amp;quot;);
            // The code below is the one i am using for reading an xlsx file
            OleDbConnection con = new OleDbConnection(@&amp;quot;Provider=Microsoft.ACE.OLEDB.12.0;Data Source=&amp;quot; + FileName + &amp;quot;;Extended Properties=\&amp;quot;Excel 12.0;HDR=YES;IMEX=1;MAXSCANROWS=0\&amp;quot;&amp;quot;);
            con.Open();
            try
            {
                //Create Dataset and fill with imformation from the Excel Spreadsheet for easier reference
                DataTable dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
                string sheetname = dt.Rows[0][&amp;quot;TABLE_NAME&amp;quot;].ToString();

                OleDbDataAdapter myCommand = new OleDbDataAdapter(&amp;quot; SELECT * FROM [&amp;quot; + sheetname + &amp;quot;]&amp;quot;, con);
                myCommand.Fill(ds);
                
            }
            catch (Exception ex)
            {
                string exce = ex.Message;
            }
            finally
            {
                con.Close();
            }
            return ds;&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>