Access Databases and AccessDataSource Controlhttp://forums.asp.net/55.aspx/1?Access+Databases+and+AccessDataSource+ControlDiscuss using Access as a data store for ASP.NET, and the AccessDataSource control.Mon, 10 Jun 2013 01:51:47 -0400urn:uuid:00000000-0000-0000-0000-000000000055urn:uuid:00000000-0000-0000-0000-000005429011http://forums.asp.net/p/1915842/5429011.aspx/1?Database+and+net+pages+on+separate+servers+Database and .net pages on separate servers? <p>Hi there,</p> <p>We are looking to update our websites to asp.net and to store the database on a separate server from the web files. &nbsp;The database will be access for now and sql server eventually. &nbsp;How can you connect to an access database on a separate server? &nbsp;Is storing the database on a separate server a good or a bad idea, performance wise? &nbsp;</p> <p>Thanks in advance!</p> <p></p> 2013-06-18T20:49:53-04:002013-06-18T20:49:53.27-04:00urn:uuid:00000000-0000-0000-0000-000005424399http://forums.asp.net/p/1914004/5424399.aspx/1?+Data+type+mismatch+in+criteria+expression+"Data type mismatch in criteria expression." <p>Hi all,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I am using Ms Access and below is my Query.</p> <pre class="prettyprint">string strSql = &quot;SELECT * from travelapproval WHERE Format([datefrom1], mm/dd/yyyy hh:nn:ss) &lt;= Date() AND Format([dateto1], mm/dd/yyyy hh:nn:ss) &gt;= Date() and approval=?&quot;;</pre> <p>I am using datefrom1 and dateto1 are text type. It shows <pre class="prettyprint">"<em><strong>Data type mismatch in criteria expression</strong></em>."</pre> <p></p> <p>Below is my Ms Access table.</p> <p><img src="http://i.stack.imgur.com/Bg4lP.jpg" alt="enter image description here"></p> <p>How can I do that?</p> 2013-06-14T10:35:18-04:002013-06-14T10:35:18.45-04:00urn:uuid:00000000-0000-0000-0000-000005426085http://forums.asp.net/p/1915172/5426085.aspx/1?Getting+Access+data+behind+the+scenes+Getting Access data behind the scenes. <p>VS 2007, C# (ASP.NET). Product database, fields ProdID / email.</p> <p>Product page has the productID which is carried over to the email page.</p> <p>On email page a note can be added to an autogenerated email.</p> <p>Problem, getting the email address from the product db without the user seeing it.</p> <p>on the page is an access source to the table in question.</p> <p>code behind that is not working:</p> <p>&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">protected</span> <span color="#0000ff" style="color:#0000ff"> void</span> Page_Load(<span color="#0000ff" style="color:#0000ff">object</span> sender, <span color="#2b91af" style="color:#2b91af">EventArgs</span> e)</p> <p>&nbsp;&nbsp;&nbsp; {</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#008000" style="color:#008000">//string RetrievedValue;</span></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">string</span> ItemNumber = Request.QueryString[<span color="#a31515" style="color:#a31515">&quot;ProductID&quot;</span>];</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">this</span>.txtSubject.Text = <span color="#a31515" style="color:#a31515">&quot;Product # &quot;</span> &#43; Request.QueryString[<span color="#a31515" style="color:#a31515">&quot;ProductID&quot;</span>];</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#008000" style="color:#008000">//RetrievedValue = &quot; Product # &quot; &#43; this.txtSubject.Text ; </span></p> <p>&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">void</span> MailTest_Click(<span color="#0000ff" style="color:#0000ff">object</span> sender, <span color="#2b91af" style="color:#2b91af">EventArgs</span> e)</p> <p>&nbsp;&nbsp;&nbsp; {</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#008000" style="color:#008000">DataView dv = AccessDataSource1.Select(DataSourceSelectArguments.Empty) ;</span><span color="#008000" style="color:#008000"></span></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">string</span> empno = dt.ItemEmailReply.ToString();</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">string</span> sTo = empno;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#008000" style="color:#008000">//string sTo = '&lt;%# Eval(&quot;ItemNum&quot;) %&gt;';</span></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#008000" style="color:#008000">//&lt;asp:Label ID=&quot;ItemNumLabel&quot; runat=&quot;server&quot; Text='&lt;%# Eval(&quot;ItemEmailReply&quot;) %&gt;' /&gt;</span></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">string</span> sFrom = txtFrom.Text.Trim();</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">string</span> sSubject = txtSubject.Text.Trim();</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">string</span> sBody = txtBody.Text.Trim();</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#0000ff" style="color:#0000ff">string</span> sMailServer = <span color="#a31515" style="color:#a31515">&quot;nnn.n.n.n&quot;</span>;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span color="#2b91af" style="color:#2b91af">MailMessage</span> MyMail = <span color="#0000ff" style="color:#0000ff">new</span> <span color="#2b91af" style="color:#2b91af"> MailMessage</span>();</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyMail.From = sFrom;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyMail.To = sTo;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyMail.Subject = sSubject;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyMail.Body = sBody;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyMail.BodyEncoding = Encoding.UTF8;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyMail.BodyFormat = <span color="#2b91af" style="color:#2b91af">MailFormat</span>.Text;</p> <p>&nbsp;</p> 2013-06-15T08:32:43-04:002013-06-15T08:32:43.957-04:00urn:uuid:00000000-0000-0000-0000-000004581697http://forums.asp.net/p/1716902/4581697.aspx/1?Inserting+DateTime+into+Acess+Database+via+C+and+Asp+netInserting DateTime into Acess Database via C# and Asp.net <p>This might be a very common and old problem, but still I've struggled with quite a lot and finally I'm posting it here:</p> <p>I've to insert DateTime in an Access database, but I'm having trouble doing so. My C# code:</p> <pre class="prettyprint">protected void Button5_Click(object sender, EventArgs e) { Panel1.Visible = true; Panel2.Visible = false; String eventname = TextBox6.Text; String description = TextBox7.Text; String coord = TextBox8.Text; String venue = TextBox9.Text; String time = TextBox10.Text; TextBox6.Text = &quot;&quot;; TextBox7.Text = &quot;&quot;; TextBox8.Text = &quot;&quot;; TextBox9.Text = &quot;&quot;; TextBox10.Text = &quot;&quot;; AccessDataSource1.InsertParameters[&quot;eventname1&quot;].DefaultValue = eventname; AccessDataSource1.InsertParameters[&quot;description1&quot;].DefaultValue = description; AccessDataSource1.InsertParameters[&quot;coordinator1&quot;].DefaultValue = coord; AccessDataSource1.InsertParameters[&quot;venue1&quot;].DefaultValue = venue; AccessDataSource1.InsertParameters[&quot;time1&quot;].DefaultValue = time; AccessDataSource1.InsertParameters[&quot;time1&quot;].DefaultValue = time; AccessDataSource1.Insert(); DataList1.EditItemIndex = -1; DataList1.DataBind(); } And the corresponding Asp.Net script:</pre> <pre class="prettyprint">&lt;asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/events.accdb" SelectCommand="SELECT * FROM [upcoming]" InsertCommand="INSERT INTO [upcoming] ([eventname], [description],[coordinator], [venue],[time]) VALUES (@eventname1, @description1,@coordinatior1, @venue1, @time1)" &gt; &lt;InsertParameters&gt; &lt;asp:Parameter Name="eventname1" Type="String" /&gt; &lt;asp:Parameter Name="description1" Type="String" /&gt; &lt;asp:Parameter Name="coordinator1" Type="String" /&gt; &lt;asp:Parameter Name="venue1" Type="String" /&gt; &lt;asp:Parameter Name="time1" Type="DateTime" /&gt; &lt;/InsertParameters&gt; &lt;/asp:AccessDataSource&gt; &lt;asp:Panel ID="Panel2" runat="server"&gt; &lt;table&gt; &lt;tr&gt;&lt;td&gt;&lt;asp:Label ID="Label6" runat="server" Text="Name:"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;td class="style1"&gt; &lt;asp:TextBox ID="TextBox6" runat="server" Height="24px" Width="548px"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;asp:Label ID="Label7" runat="server" Text="Description:"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;td class="style1"&gt; &lt;asp:TextBox ID="TextBox7" runat="server" Height="155px" TextMode="MultiLine" Width="555px"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;asp:Label ID="Label8" runat="server" Text="Event Coordinators:"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;td class="style1"&gt; &lt;asp:TextBox ID="TextBox8" runat="server" Width="548px"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt; &lt;asp:Label ID="Label9" runat="server" Text="Venue:"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;td class="style1"&gt; &lt;asp:TextBox ID="TextBox9" runat="server" Width="546px"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;asp:Label ID="Label10" runat="server" Text="Date &amp;Time:"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;td class="style1"&gt; &lt;asp:TextBox ID="TextBox10" runat="server" Height="23px" Width="543px"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt; &lt;asp:Button ID="Button5" runat="server" Text="Insert" onclick="Button5_Click" /&gt;&lt;/td&gt; &lt;td class="style1"&gt; &lt;asp:Button ID="Button6" runat="server" CommandName="Cancel" Text="Cancel" onclick="Button6_Click" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;table/&gt; &lt;/asp:Panel&gt; <br />Please help me in inserting the datetime through the given mechanism.</pre> 2011-09-03T05:41:02-04:002011-09-03T05:41:02.86-04:00urn:uuid:00000000-0000-0000-0000-000005416867http://forums.asp.net/p/1912213/5416867.aspx/1?Connection+String+in+Access+databaseConnection String in Access database <p>I am trying to get my connection string to work with a Microsoft Access database.</p> <p>This is what I have thus far:</p> <p>In web.config:</p> <p>&lt;configuration&gt;<br> &nbsp; &lt;connectionStrings&gt;<br> &nbsp;&nbsp;&nbsp; &lt;add name=&quot;myConnString&quot; connectionString=&quot;Data Source=|DataDirectory|\db1.mdb;Integrated Security=True;&quot; providerName=&quot;System.Data.Oledb&quot; /&gt;<br> &nbsp; &lt;/connectionStrings&gt;</p> <p>&lt;configuration&gt;</p> <p>In ASP.net:</p> <p><br> &nbsp;&nbsp;&nbsp; Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim strConn As String = System.Configuration.ConfigurationManager.ConnectionStrings(&quot;myConnString &quot;).ConnectionString<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Conn As New OleDbConnection(strConn)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; etc</p> 2013-06-06T16:19:35-04:002013-06-06T16:19:35.55-04:00urn:uuid:00000000-0000-0000-0000-000005418000http://forums.asp.net/p/1912477/5418000.aspx/1?Need+a+Help+with+insert+update+and+delete+data+using+a+access+databaseNeed a Help with insert. update and delete data using a access database <p></p> <p><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"></span></span></p> <p>Hi All I need someone to teach me some features in Visual Studio from scratch&nbsp;online&nbsp; to complete the following&nbsp;<span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt">task .</span></p> <p><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"></span></span></p> <p><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt">1. To be able to create a form to add data to an access database </span></p> <p><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"></span></span></p> <p><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt">2. To be able to Search data from access database in a gridview or list view .</span></span></p> <p><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"></span></span></p> <p><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt">3. To be able to create a user login page base on the access level of the user.</span></span></p> <p><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"></span></span></p> <p><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"><span style="color:black; font-family:'Segoe UI','sans-serif'; font-size:10pt"></span></span></p> 2013-06-07T16:29:36-04:002013-06-07T16:29:36.097-04:00urn:uuid:00000000-0000-0000-0000-000005411050http://forums.asp.net/p/1910913/5411050.aspx/1?Implementing+a+audit+trail+for+our+applicationImplementing a audit trail for our application <p>I want to add an audit trail for our system so when any Add/Delete/Update operation happen i will log it, with the following info:-</p> <ol> <li> <p>the CRUD operation type. is it add, delete or update.</p> </li><li> <p>the record ID which have been modified.</p> </li><li> <p>Date and time.</p> </li></ol> <p>Now i found two approaches to follow; <strong>either</strong> to have a single audit trail table with the following fields:-</p> <ul> <li>ID .such as 123445. </li><li>CRUD_description. Such as Delete </li><li>Record_ID. Such as Qaeop12771 </li><li>Date. Such as 1june2O13 </li></ul> <p><strong>Or</strong> to have two tables one for a lookup table for the CRUD operation such as</p> <ul> <li>CRUD_ID. such as 3. </li><li>CRUD_Description.such as Delete. </li></ul> <p>And then the Audit trial will reference the above table:-</p> <ul> <li>ID. such as 123445. </li><li>CRUD_ID (this will be a foreign key to the CRUD table) such as 3. </li><li>Record_ID. Such as Qaeop12771 </li><li>Date. Such as 1june2O13 </li></ul> <p>So which approach is better ??</p> <p>Second question If i will follow the second approach . Then is it preferred to use the CRUD_ID inside my code for example if the oprration is delete i might have my code look like:-</p> <pre class="prettyprint">Inset into audit_trail (ID, CRUD_ID, Record_ID, Date) values ( 123445, 3,12771,1june2O13)</pre> <p>// CRUD_ID 3 represents delete opration</p> <p>Best Regards</p> 2013-06-01T01:27:42-04:002013-06-01T01:27:42.813-04:00urn:uuid:00000000-0000-0000-0000-000005400941http://forums.asp.net/p/1908478/5400941.aspx/1?display+only+the+dashboards+of+the+authentificated+userdisplay only the dashboards of the authentificated user <p>Hi everybody,</p> <p>i want to ask for your help, i have a problem in my database , with the JDash.net dashboard</p> <p>this is my problem , my web page http://img5.imageshack.us/img5/1/sanstitrekg.png , when i click in &quot;Ajouter un profil&quot; a have a popup , with a textbox and a button , where i enter the name of the dashboard and confirm the creation ..</p> <p>for example i have two users &quot; pazzo&quot; &amp; &quot;milan&quot; , with the user pazzo i create two dashboards &quot; Sport &quot; &amp; &quot;Music&quot; , with the user milan i create &quot; News&quot; &amp; &quot;People&quot;</p> <p>this is the result in my database ( dashboard ) table , http://img254.imageshack.us/img254/3367/sanstitre1awj.png ,</p> <p>but when i authentificates whith the user pazzo for example , i have this http://img812.imageshack.us/img812/6386/sanstitre2yqz.png</p> <p>i wanna to display only the dashboards of the user &quot;pazzo&quot; ( Sport &amp; Music) ,</p> <p>i'm usin the default table of createuserwizard <br> i need your help please!!</p> 2013-05-21T11:45:31-04:002013-05-21T11:45:31.15-04:00urn:uuid:00000000-0000-0000-0000-000005410379http://forums.asp.net/p/1910735/5410379.aspx/1?getting+a+record+thet+is+between+2+datesgetting a record thet is between 2 dates <p>het guys</p> <p>my employer wants to have a form that gets you the expenses between 2 dates.</p> <p>i have looked a lot on the internet but i couldn't find anything that could solve my problem.</p> <p>because the problem is that the 2 dates only have a specified month and year and both are in a different field.</p> <p>could you guys please help me?</p> 2013-05-31T08:05:49-04:002013-05-31T08:05:49.063-04:00urn:uuid:00000000-0000-0000-0000-000005409356http://forums.asp.net/p/1910490/5409356.aspx/1?How+can+i+bind+variables+to+database+in+sql+server+How can i bind variables to database in sql server? <p>&nbsp;I have designed a page using inline programming that is using strbuild.append.</p> <p>I have declared strings which i want to be fetched from the database.</p> <p>Eg. String address =&quot;&quot;;</p> <p>strbuild.append(&quot;address is&quot;&#43;address);</p> <p>i want address from the database.</p> <p>Please tell me about it including establishing the connection as well</p> 2013-05-30T09:44:02-04:002013-05-30T09:44:02.017-04:00urn:uuid:00000000-0000-0000-0000-000005411265http://forums.asp.net/p/1910965/5411265.aspx/1?binding+table+to+databasebinding table to database <p>i have assigned the following variables as:</p> <p>string[] s_no=&quot;&quot;'</p> <p>string[] emp_name=&quot;&quot;;</p> <p>i have a table at backend which contains the above entities.</p> <p>how can i access those multiple value and bind it to a single variable?</p> <p>should i do it using array only or by loop?</p> <p>in both cases how?</p> 2013-06-01T09:07:55-04:002013-06-01T09:07:55.653-04:00urn:uuid:00000000-0000-0000-0000-000005411045http://forums.asp.net/p/1910912/5411045.aspx/1?Forcing+a+field+uniqueness+on+the+database+is+it+a+bad+designForcing a field uniqueness on the database is it a bad design &lt;div class=&quot;post-text&quot; itemprop=&quot;description&quot;&gt; <p>I have the following tables.</p> <ol> <li> <p><strong>Available_Ip_Address</strong> (IP_Address_ID (Primary Key ), description, status ).</p> </li><li> <p><strong>Virtual_Machine</strong> (VM_ID (Primary Key ), description, IP_Address (foreign key ) )</p> </li></ol> <p>The scenario is as follow:-</p> <ol> <li> <p>we maintain all the available IP address of a single table.</p> </li><li> <p>we maintain the virtual machine info in another table , but specific IP address can be assigned to a single VM at any time.</p> </li><li>so i have added a drop down list when adding a VM which contain all the IP address that have their status as “available”. </li><li>but since two users can create a VM and they might select the same available IP address </li><li>so i found that the best way to protect our system is to make the foreign key IP_Address in the Virtual_Machine table unique. </li><li>then if two users select the same IP address an exception will be raised in the Database for one of them and i can propagate the exception and then display a user friendly message to the user that the IP address might have being already taken. </li></ol> <p>So is my approach considered a valid design, or i should look for adding a timestamp field on the IP_address field so if the status of the IP address was changed since it was last queried then the record will have new timestamp and a exception will be raised on the application level.</p> <p>Best Regards</p> &lt;/div&gt; 2013-06-01T01:12:45-04:002013-06-01T01:12:45.31-04:00urn:uuid:00000000-0000-0000-0000-000005408558http://forums.asp.net/p/1910302/5408558.aspx/1?Access+Data+Provider+version+issuesAccess Data Provider version issues <p>I have a website with a data connection.&nbsp; The&nbsp;data connection reads as such:</p> <p>&lt;<span size="3" color="#a31515" face="Times New Roman" style="font-family:Times New Roman; color:#a31515; font-size:medium"><span size="3" color="#a31515" face="Times New Roman" style="font-family:Times New Roman; color:#a31515; font-size:medium"><span size="3" color="#a31515" face="Times New Roman" style="font-family:Times New Roman; color:#a31515; font-size:medium">add</span></span></span><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"> </span></span></span><span size="3" color="#ff0000" face="Times New Roman" style="font-family:Times New Roman; color:#ff0000; font-size:medium"><span size="3" color="#ff0000" face="Times New Roman" style="font-family:Times New Roman; color:#ff0000; font-size:medium"><span size="3" color="#ff0000" face="Times New Roman" style="font-family:Times New Roman; color:#ff0000; font-size:medium">name</span></span></span><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">=</span></span></span><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium"><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium">&quot;</span></span><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">MainDbConnection</span></span></span><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium"><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium">&quot;</span></span><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"> </span></span></span><span size="3" color="#ff0000" face="Times New Roman" style="font-family:Times New Roman; color:#ff0000; font-size:medium"><span size="3" color="#ff0000" face="Times New Roman" style="font-family:Times New Roman; color:#ff0000; font-size:medium"><span size="3" color="#ff0000" face="Times New Roman" style="font-family:Times New Roman; color:#ff0000; font-size:medium">connectionString</span></span></span><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">=</span></span></span><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium"><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium">&quot;</span></span><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\MssOnlineTemplate.accdb</span></span></span><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium">&quot; </span><span size="3" color="#ff0000" face="Times New Roman" style="font-family:Times New Roman; color:#ff0000; font-size:medium"><span size="3" color="#ff0000" face="Times New Roman" style="font-family:Times New Roman; color:#ff0000; font-size:medium"><span size="3" color="#ff0000" face="Times New Roman" style="font-family:Times New Roman; color:#ff0000; font-size:medium">providerName</span></span></span><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">=</span></span></span><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium"><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium">&quot;</span></span><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">System.Data.OleDb</span></span></span><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium"><span size="3" face="Times New Roman" style="font-family:Times New Roman; font-size:medium">&quot; </span></span><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">/&gt;</span></p> <p><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">Works great on my machine, but when I transfer it to another developer's box, it give the error:</span></p> <p><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.</span></p> <p><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">Which is, of course, because he doesn't have access installed on his computer.&nbsp; </span></p> <p><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium">But now the main issue is when we send this to the customer for his review.&nbsp; The customer may not have Access, or not the same version as mine.&nbsp; So how do I take care of this in deployment?&nbsp; Is there a way to make sure the VS 2012 publish tool includes the appropriate drivers, or is there a more generic driver I should be using - something more intrinsic to the .net framework?</span></p> <p></p> <p><span size="3" color="#0000ff" face="Times New Roman" style="font-family:Times New Roman; color:#0000ff; font-size:medium"></span></p> 2013-05-29T15:39:47-04:002013-05-29T15:39:47.927-04:00urn:uuid:00000000-0000-0000-0000-000005407566http://forums.asp.net/p/1910102/5407566.aspx/1?How+to+retrieve+data+from+database+to+radiobuttonlist+How to retrieve data from database to radiobuttonlist? <p>Supposed I have the form below with values coming from a database, how do I know which Item was selected&nbsp;<strong>selected</strong>? Please not value store on db is as text not true or false.&nbsp;</p> <p>---- aspx page-----</p> <pre class="prettyprint">&lt;form runat=&quot;server&quot;&gt; &lt;asp:RadioButtonList id=&quot;radiolist1&quot; runat=&quot;server&quot;&gt; &lt;asp:ListItem <span> </span>GroupName<span>=</span>&quot;Software&quot;<span> </span>AutoPostBack<span>=</span>&quot;true&quot;<span></span>&gt;Asp.net&lt;/asp:ListItem&gt; &lt;asp:ListItem <span> </span>GroupName<span>=</span>&quot;Software&quot;<span> </span>AutoPostBack<span>=</span>&quot;true&quot;<span></span>&gt;Coldfusion&lt;/asp:ListItem&gt; &lt;asp:ListItem <span> </span>GroupName<span>=</span>&quot;Software&quot;<span> </span>AutoPostBack<span>=</span>&quot;true&quot;<span></span>&gt;C&lt;/asp:ListItem&gt; &lt;asp:ListItem GroupName<span>=</span>&quot;Software&quot;<span> </span>AutoPostBack<span>=</span>&quot;true&quot;<span></span>&gt;Other&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; &lt;br&gt; &lt;asp:Button text=&quot;Update&quot; OnClick=&quot;submit&quot; runat=&quot;server&quot;/&gt;</pre> <p>---aspx.cs ----</p> <pre class="prettyprint">protected void Page_Load(object sender, EventArgs e) { using (OracleConnection con = new OracleConnection(connectionString)) { string sql_select = "SELECT softwareType FROM HABBIESTABLE WHERE USER='" + id.ToString() + "'"; OracleCommand cmnd = new OracleCommand(sql_select, con); con.Open(); OracleDataReader reader = cmnd.ExecuteReader(); while (reader.Read()) { // I don't know what I am doing here below :( ListItem item = new ListItem(); item.Text = reader["softwareType"].ToString(); item.Value = reader["RadioButtonMyItems"].ToString(); item.Selected = Convert.ToBoolean(reader["softwareType"]); RadioButtonCourses.Items.Add(item); } }</pre> <p>I can't get it to work. Can you help?!<br> <br> </p> <p>Thank you everyone</p> 2013-05-28T22:06:02-04:002013-05-28T22:06:02.523-04:00urn:uuid:00000000-0000-0000-0000-000005404332http://forums.asp.net/p/1909319/5404332.aspx/1?Copy+data+from+a+stored+procedure+into+an+access+table+Copy data from a stored procedure into an access table. <p>Hi i need to take data from a SQL Server table and copy the data in an access 2003.<br> I am using vb.net<br> I have Stored procedure that return around 20 000 rows.<br> I create a Datset that conain all the info from the stored prcedure.<br> Is there an easy way to copy all the data from my Dataset into my access table.<br> Right now it working but i am looping throught all my row i'am sure thre a better way of doing that?</p> <p>Is there a way to do something like :</p> <p>insert into xxx IN 'Datset or Stored Procedure Name'<br> Tks</p> <p>Here what i have :</p> <pre class="prettyprint">Dim myconnection As SqlConnection Dim sqlGetEleveFromStaging As SqlDataAdapter Dim oDs As New DataSet myconnection = New SqlConnection(ConfigurationManager.ConnectionStrings(&quot;xxx&quot;).ConnectionString) sqlGetEleveFromStaging = New SqlDataAdapter(&quot;Info&quot;, myconnection) sqlGetEleveFromStaging.SelectCommand.CommandType = CommandType.StoredProcedure sqlGetEleveFromStaging.Fill(oDs)</pre> <pre class="prettyprint">Dim connectionStudDemo As OleDbConnection connectionStudDemo = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source= " + MapPath("xxx.mdb")) connectionStudDemo.Open() For a = 0 To oDs.Tables(0).Rows.Count - 1 strSQl = "insert into eleves (xxx) VALUES ('" &amp; oDs.Tables(0).Rows(a).Item("xxx") &amp; "') Next</pre> <p><br> &nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> 2013-05-24T11:27:56-04:002013-05-24T11:27:56.317-04:00urn:uuid:00000000-0000-0000-0000-000005034891http://forums.asp.net/p/1816749/5034891.aspx/1?AccessDataBaseEngine+exe+not+able+to+read+more+than+8000+records+from+excel+sheetAccessDataBaseEngine.exe + not able to read more than 8000 records from excel sheet <p>Hi,</p> <p>I installed AccessDataBaseEngine.exe on Windows Server 2008 R2 (VM) and using it for reading excel files using Asp.net C#; I've an excel file which has almost 80000 records, but I am able to read only 8128 records from the excel sheet. I am using the following connection string for reading records from excel sheet - <br> Provider=Microsoft.ACE.OLEDB.12.0;Data Source=***UploadedExcelFilePath***;Extended Properties=Excel 12.0;&quot;</p> <p>Any ideas how to resolve this???</p> 2012-06-21T07:08:53-04:002012-06-21T07:08:53.833-04:00urn:uuid:00000000-0000-0000-0000-000005401756http://forums.asp.net/p/1908692/5401756.aspx/1?how+to+connect+to+local+server+database+from+ftp+how to connect to local server database from ftp? <p>hi..</p> <p>I am using ASP.net 4.0 and MS Access 2010 as the database.My database name is HR Portal and i have put it in the web hosting server.I have a central Database in the local server of my Company office.Both the databases contain some common tables.My issue is that whenever any insertion or updation takes place in the HR Portal(which is online),that updations should be made in the Central database located in the local server.Since i cannot connect to the&nbsp;central database from ftp,is there any other option to bring the updates on the central database.Someone please help me to solve this....&nbsp;</p> 2013-05-22T06:29:05-04:002013-05-22T06:29:05.1-04:00urn:uuid:00000000-0000-0000-0000-000005394746http://forums.asp.net/p/1906222/5394746.aspx/1?Operation+must+use+an+updateable+queryOperation must use an updateable query <p>hi..</p> <p>I am using ASP.net 4.0 and MS access 2010&nbsp; as database.my website was working fine locally.When i hosted it in the web,during insert operation,this error is coming: &quot;Operation must use an updateable query&quot;.What should i do to solve this error.I tried to change the permissions in the app_data folder,but alrealy read and write options are given for the user and administrator.Should i login as administrator to solve this issue.Please someone help me..I'm really in trouble.</p> 2013-05-15T12:55:30-04:002013-05-15T12:55:30.507-04:00urn:uuid:00000000-0000-0000-0000-000005401529http://forums.asp.net/p/1908625/5401529.aspx/1?Help+in+displaying+data+from+MS+Access+with+arrayHelp in displaying data from MS Access with array <p>Hello, I have created a code which display a text based on the select keyword. It was successful when I used textbox, but now I am trying it with array instead. So i change the textbox part to array value, but somehow I cannot display the words. Can anyone please help me.</p> <p>This is my code:</p> <pre class="prettyprint">&lt;div&gt; &lt;asp:Textbox ID=&quot;test&quot; TextMode=&quot;MultiLine&quot; Height=&quot;200px&quot; Width=&quot;200px&quot; runat=&quot;server&quot; /&gt; &lt;asp:Button ID=&quot;button&quot; runat=&quot;server&quot; OnClick=&quot;Button1_Click&quot; Text=&quot;Submit&quot; /&gt; &lt;/div&gt;</pre> <pre class="prettyprint"> protected void Button1_Click(object sender, EventArgs e) { string[] array = new string[2]; array[0] = "Animal"; array[1] = "Eat"; string ConnectString = "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=" + @"D:\\Database1.accdb;"; OleDbConnection objCon; OleDbCommand objCmd; string GetSql = string.Empty; GetSql = "(SELECT * FROM table1 where Word = '" + array.ToString().ToUpper() + "' )"; using (objCon = new OleDbConnection(ConnectString)) { objCon.Open(); using (objCmd = new OleDbCommand(GetSql, objCon)) { OleDbDataReader Dr = objCmd.ExecuteReader(); if (Dr.HasRows) { while (Dr.Read()) { string val = Dr.IsDBNull(Dr.GetOrdinal("Verb")) ? null : Dr["Verb"].ToString(); test.Text = array.ToString().ToUpper() + " " + val; } } else { test.Text = "ERROR"; } } objCon.Close(); } }</pre> <p><br> <br> <br> </p> 2013-05-22T02:04:00-04:002013-05-22T02:04:00.91-04:00urn:uuid:00000000-0000-0000-0000-000005400471http://forums.asp.net/p/1908386/5400471.aspx/1?Receive+an+error+when+trying+to+connect+to+MS+AccessReceive an error when trying to connect to MS Access <p>Hai, this is the error that I receive:</p> <h2>'D:/Database1.accdb;' is a physical path, but a virtual path was expected.</h2> <p>Should I add anything in the web.config?</p> <p>This is my code, please help:</p> <pre class="prettyprint">using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.OleDb; public partial class Test : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string ConnectString = &quot;PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=&quot; &#43; MapPath(@&quot;D:\\Database1.accdb;&quot;); OleDbConnection objCon; OleDbCommand objCmd; string GetSql = string.Empty; GetSql = &quot;(SELECT * FROM table1 where Word = '&quot; &#43; test.Text.ToUpper() &#43; &quot;' )&quot;; using (objCon = new OleDbConnection(ConnectString)) { objCon.Open(); using (objCmd = new OleDbCommand(GetSql, objCon)) { OleDbDataReader Dr = objCmd.ExecuteReader(); if (Dr.HasRows) { while (Dr.Read()) { string val = Dr.IsDBNull(Dr.GetOrdinal(&quot;Verb&quot;)) ? null : Dr[&quot;Verb&quot;].ToString(); test1.Text = test.Text.ToUpper() &#43; &quot; &quot; &#43; val; } } else { test1.Text = &quot;ERROR&quot;; } } objCon.Close(); } } }</pre> <p><br> <br> </p> <p></p> 2013-05-21T06:19:42-04:002013-05-21T06:19:42.74-04:00