The e-webdesigns blog

Name: Ashley
Home: Derbyshire, United Kingdom
About Me: Someone who is interested in technology, design and inovation and using technology to find solutions to problems.
See my complete profile

| More

ASP.net C# - Insert record into MS Access DB on button click

Friday, 5 March 2010
I was searching the net the other day for a quick way to insert a record into a Access Database using a connection string setup in the web.confif file.

There seems to be 100's out there for SQL Server but not many for MS Access. This is how i did it in the end.

The web.config file:


<configuration>
<appsettings>
<connectionstrings>
<add name="ConnectionString" connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\DB1.mdb;Persist Security Info=Trueprovidername="System.Data.OleDb">

</connectionstrings>
<system.web>...

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using System.Data.SqlClient;

protected void Button1_Click(object sender, EventArgs e)
{
OleDbConnection conn;
OleDbCommand cmd;
using (conn = new OleDbConnection(ConfigurationManager.ConnectionStrings "ConnectionString"].ConnectionString))
{
using (cmd = conn.CreateCommand())
{
cmd.CommandText = "INSERT INTO Xref_Roles_Users (Role, Users) VALUES ('" + Request.Form["DropDownList1"] + "','" + Request.Form["ListBox1"] + "')";
conn.Open();
cmd.ExecuteNonQuery();
cmd.Dispose();
}
}
}

Labels:

chernobyl 2000

Wednesday, 13 January 2010
I've been working on the new chernobyl2000 website. It's still in development, but you should be able to see the latest design on: www.chernobyl2000.co.uk.

The Importance of Usability

Saturday, 5 September 2009
Usability should be the highest priority when designing a website I come across so many websites that do fancy stuff and look really cool. but so often with these sites, I also find them hard to navigate the site, and if I can't use it then I'll just go elsewhere.

This is why usability is so important, forget your fancy scripts that do amazing things, if the user can't get to where they want to go on your site, then they're probably just give up and go else where.

Find your red route!


They'll be a page on your site that you want your users to end on, whether this will be a check out page where your customers page for goods or something like a contact us page. draw out the route of how the your users will get there is it really that obvious? how quickly and easy can they get there?

Labels:

New Google search - caffeine

Wednesday, 12 August 2009

Google, arguably the leading search engine in the world has announced that a team of Googlers have been working away on the next generation of Google.

So what does this mean to you, me and everybody and their dog? The answer, Probably not a lot. OK for all you SEO experts out there, I'm guessing the algorithm has changed, but to Joe public the same clean cut, basic, super user friendly white page with the Google logo and the 2 buttons will undoubtedly stay the same.

It looks to me using the sandbox pre beta release that it certainly brings back a whole load more search results and at a super fast speed. I believe Google will be using "real time" technologies the same that Facebook and other social networking sites use. to deal with the "breaking news" search queries.

But for now, I'll keep playing and dig around some more...

Labels: