Visual Web Developer 2008 Express and MS Access 2007

Does the VWD 2008 Express edition bind *.Accdb databases?

0
asante_za
4/16/2009 8:11:01 AM
asp.net.web-dev-2008-express 1205 articles. 0 followers. Follow

1 Replies
623 Views

Similar Articles

[PageSpeed] 32
Get it on Google Play
Get it on Apple App Store

 Ofcourse it can bind ... but you must use different data provider .

 

String ConnectionStringSampleDB = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\\personalinfo.accdb;Persist Security Info=True";

  

use this connection string ... its work for me ,

total sample code ...is here  Design part

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>WelCome || Sample Database connetion Between ASP.NET C# and MS Access Database </title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table cellpadding="0" cellspacing="0" class="style1">
            <tr>
                <td>
                    </td>
                <td style="width: 800px">
                    </td>
                <td>
                    </td>
            </tr>
            <tr>
              <td>
                    </td>
                <td style="width: 800px">
                    <table cellpadding="5" cellspacing="5" class="style1">
                        <tr>
                            <td colspan="3">
                                <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="20pt" 
                                    ForeColor="#009933" Text="Personal Information"></asp:Label>
                                <hr />
                                </td>
                        </tr>
                        <tr>
                            <td style="width: 30%">
                                <asp:Label ID="Label2" runat="server" Text="Name :"></asp:Label>
                                </td>
                            <td style="width: 50%">
                                <asp:TextBox ID="txtName" runat="server" Width="80%"></asp:TextBox>
                                </td>
                            <td style="width: 20%">
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ControlToValidate="txtName" ErrorMessage="Name Cannot be blank"></asp:RequiredFieldValidator>
                                </td>
                        </tr>
                        <tr>
                           <td style="width: 30%">
                                <asp:Label ID="Label3" runat="server" Text="Email :"></asp:Label>
                                </td>
                            <td style="width: 50%">
                                <asp:TextBox ID="txtEmail" runat="server" Width="80%"></asp:TextBox>
                                </td>
                            <td style="width: 20%">
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                    ControlToValidate="txtEmail" ErrorMessage="Email cannot be blank"></asp:RequiredFieldValidator>
                                </td>
                        </tr>
                        <tr>
                           <td style="width: 30%">
                                <asp:Label ID="Label4" runat="server" Text="Phone :"></asp:Label>
                                </td>
                            <td style="width: 50%">
                                <asp:TextBox ID="txtPhone" runat="server" Height="22px"></asp:TextBox>
                                </td>
                            <td style="width: 20%">
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                    ControlToValidate="txtPhone" ErrorMessage="Phone cannot be blank"></asp:RequiredFieldValidator>
                                </td>
                        </tr>
                        <tr>
                          <td style="width: 30%; vertical-align: top;">
                                <asp:Label ID="Label5" runat="server" Text="Address :"></asp:Label>
                                </td>
                            <td style="width: 50%">
                                <asp:TextBox ID="txtAdd" runat="server" Height="50px" TextMode="MultiLine" 
                                    Width="80%"></asp:TextBox>
                                </td>
                            <td style="width: 20%; vertical-align: top;">
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                    ControlToValidate="txtAdd" ErrorMessage="Address cannot be blank"></asp:RequiredFieldValidator>
                                </td>
                        </tr>
                        <tr>
                          <td style="width: 30%">
                                <asp:Label ID="Label6" runat="server" Text="Job :"></asp:Label>
                                </td>
                            <td style="width: 50%">
                                <asp:TextBox ID="txtJob" runat="server"></asp:TextBox>
                                </td>
                            <td style="width: 20%">
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                    ControlToValidate="txtJob" ErrorMessage="Job cannot be blank"></asp:RequiredFieldValidator>
                                </td>
                        </tr>
                        <tr>
                          <td style="width: 30%; vertical-align: top;">
                                <asp:Label ID="Label7" runat="server" Text="Comments :"></asp:Label>
                                </td>
                            <td style="width: 50%">
                                <asp:TextBox ID="txtComments" runat="server" Height="68px" TextMode="MultiLine" 
                                    Width="80%"></asp:TextBox>
                                </td>
                            <td style="width: 20%; vertical-align: top;">
                                </td>
                        </tr>
                        <tr>
                        <td colspan="3">
                                
                                <asp:Button ID="Clear" runat="server" BorderStyle="Dotted" 
                                    CausesValidation="False" Font-Bold="True"  Text="Clear" 
                                    Width="140px" onclick="Clear_Click" />
                                
                                <asp:Label ID="lblmgs" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                                <hr /></td>
                        </tr>
                        <tr>
                        <td colspan="3">
                                <table cellpadding="2" class="style1">
                                    <tr>
                                        <td style="width: 20%">
                                            <asp:Button ID="btnInsert" runat="server" Font-Bold="True" Text="Insert" 
                                                Width="98%" BorderStyle="Dotted" onclick="btnInsert_Click" />
                                            </td>
                                       <td style="width: 20%">
                                            <asp:Button ID="btnUpdate" runat="server" Font-Bold="True" Text="Update" 
                                                Width="98%" BorderStyle="Dotted" onclick="btnUpdate_Click" />
                                            </td>
                                       <td style="width: 20%">
                                            <asp:Button ID="btnDelete" runat="server" Font-Bold="True" Text="Delete" 
                                                Width="98%" BorderStyle="Dotted" CausesValidation="False" 
                                                onclick="btnDelete_Click" />
                                            </td>
                                       <td style="width: 20%">
                                            <asp:TextBox ID="txtSearch" runat="server" Width="98%"></asp:TextBox>
                                            </td>
                                       <td style="width: 20%">
                                            <asp:Button ID="btnSearch" runat="server" Font-Bold="True" Text="Search" 
                                                Width="98%" BorderStyle="Dotted" CausesValidation="False" 
                                                onclick="btnSearch_Click" />
                                            </td>
                                    </tr>
                                </table>
                                </td>
                        </tr>
                    </table>
                    </td>
                <td>
                    </td>
            </tr>
            <tr>
               <td>
                     </td>
                <td style="width: 800px">
                    <asp:Label ID="Label8" runat="server" Font-Bold="True" Text="Total Record :"></asp:Label>
                    </td>
                <td>
                     </td>
            </tr>
            <tr>
               <td>
                     </td>
                <td style="width: 800px">
                    <asp:GridView ID="GridView1" runat="server" Width="100%">
                        <AlternatingRowStyle BorderStyle="Solid" />
                    </asp:GridView>
                    </td>
                <td>
                     </td>
            </tr>
            <tr>
               <td>
                    </td>
                <td style="width: 800px">
                    </td>
                <td>
                    </td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
 
Code behind  
 
using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.OleDb;

public partial class _Default : System.Web.UI.Page
{
    //declare Connection string
    String ConnectionStringSampleDB = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\\personalinfo.accdb;Persist Security Info=True";

    protected void Page_Load(object sender, EventArgs e)
    {
        LoadData();//call loaddata 
    }
    protected void btnInsert_Click(object sender, EventArgs e)
    {
        
        OleDbConnection cn = new OleDbConnection(ConnectionStringSampleDB);//create connection
        cn.Open();//Open connection
        string strSave = "insert into Info_TBL Values(";
        strSave = strSave + "'" + txtName.Text + "'";
        strSave = strSave + ",'" + txtEmail.Text + "'";
        strSave = strSave + ",'" + txtPhone.Text + "'";
        strSave = strSave + ",'" + txtAdd.Text + "'";
        strSave = strSave + ",'" + txtJob.Text + "'";
        strSave = strSave + ",'" + txtComments.Text + "')";

        OleDbCommand cmd = new OleDbCommand(strSave, cn);//create command
        cmd.ExecuteNonQuery();//Finally execute
        cn.Close();//connection close

        lblmgs.Text = "Succesfully Insert Data";
        LoadData();
        Clear_Data();
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        
        OleDbConnection cn = new OleDbConnection(ConnectionStringSampleDB);
        cn.Open();//Open connection

        string strUpdate = "update Info_TBL set Email = '" + txtEmail.Text + "',Phone ='" + txtPhone.Text + " ',Address ='" + txtAdd.Text + "',Job ='" + txtJob.Text + "'where Name ='" + txtName.Text + "'";
        OleDbCommand sqlCmd = new OleDbCommand(strUpdate, cn);
        sqlCmd.ExecuteNonQuery();
        
        lblmgs.Text = "Update successfully";
        cn.Close();
        LoadData();
 
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        if (txtName.Text == "")
        {
            lblmgs.Text = "You need to Put Name!!!";
        }
        else
        {

            OleDbConnection cn = new OleDbConnection(ConnectionStringSampleDB);
            cn.Open();//Open connection

            string strDel = "Delete from Info_TBL where Name='" + txtName.Text + "'";
            OleDbCommand oleCmd = new OleDbCommand(strDel, cn);
            oleCmd.ExecuteNonQuery();
           
            lblmgs.Text = "Deleted successfully";
            cn.Close();
            LoadData();
        }
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        
        OleDbConnection cn = new OleDbConnection(ConnectionStringSampleDB);
        cn.Open();//Open connection
        string strserch = "Select * from Info_TBL Where Name='" + txtSearch.Text + "'";
        
        OleDbDataAdapter da = new OleDbDataAdapter(strserch, cn);// create data adapter
        DataTable dt = new DataTable();//declare data table
        DataSet ds = new DataSet();// declare a data set
        da.Fill(ds, "Info_TBL");//
        dt = ds.Tables["Info_TBL"];

        if (dt.Rows.Count > 0)//search data is present or not
        {
            txtName.Text = dt.Rows[0]["Name"].ToString();
            txtEmail.Text = dt.Rows[0]["Email"].ToString();
            txtPhone.Text = dt.Rows[0]["Phone"].ToString();
            txtAdd.Text = dt.Rows[0]["Address"].ToString();
            txtJob.Text = dt.Rows[0]["Job"].ToString();
            txtComments.Text = dt.Rows[0]["Comments"].ToString();

        }
        else
        {
            lblmgs.Text = "Data Not Found";
        }
        cn.Close();
        LoadData();

    }
    void LoadData()
    {
        OleDbConnection cn = new OleDbConnection(ConnectionStringSampleDB);
        cn.Open();//Open connection
        string strserch = "Select * from Info_TBL";

        OleDbDataAdapter da = new OleDbDataAdapter(strserch, cn);
       
        DataSet ds = new DataSet();
        da.Fill(ds, "Info_TBL");// load data into adadpter

        GridView1.DataSource = ds;
        GridView1.DataBind();// finally bind in datagrid
    }
    void Clear_Data()
    {
        txtName.Text = string.Empty;
        txtEmail.Text = string.Empty;
        txtPhone.Text = string.Empty;
        txtJob.Text = string.Empty;
        txtAdd.Text = string.Empty;
        txtComments.Text = string.Empty;
    }

    protected void Clear_Click(object sender, EventArgs e)
    {
        Clear_Data();
    }
}
  
 

Md. Parves Kawser


Please remember to click “Mark as Answer” on the post that helps you.
0
rezakawser
4/18/2009 4:17:55 AM
Reply:

Similar Artilces:

Visual Studion Express 2008 SP1, Visual Web Developer Express 2008 and Web Application Project Template
Hi All, I installed Visual Web Developer Express 2008 sp1 on my two machines, one running Vista & other running XP. On the XP machine, when I open VWD Express 2008 I get an option to use Web Application project template as a new project option but on my Vista machine I only get an option to use Web site model template option. My question is, is the sp1 incompatible with vista? Any help or explanation would be appreciated   Thanks SP1 is compatible with vista.  I would try devenv.exe /installvstemplates to see if you could force vwd to see the other project types otherwise ...

Visual web developer 2005 express to visual web developer 2008 express
 I created a project(web site) in vwd 2005 on Win XP. Upon trying vwd 2008 on Vista home premium, and opening the project and selecting to convert to 3.5 .Net, the formatting is not correct. All images are sent way over to the right. Everything else works fine.Anybody else have this problem, or similar?TIA Този уебсайт е твърде бавен. Мисля, че IIS 7 не е конфигуриран правилно. Моля, премахнете банери по-горе. Rendering difference is not a result of conversion. 2008 designer is completely different from 2005, there is no common code. 2005 designer was based in IE6 while 2008 is b...

How to use Visual Web Developper 2008 Express Edition with Visual C# 2008 Express Edition for n-tier development
Can these products be bundled when working in a n-tier project? What are the best practise methods? Or is moving to Visual Studio 2008 Standard Editon the solution? In most cases you will find all you need is in VWD 2008, If you install SP1 then you can compile class libraries now as well, so less need for c#2008. Also you might find this good to read http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=416 Hope it helpsRegardsJeremyIf this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.That way future readers will know which post solve...

I cannot use SQL Server 2008 Express with Visual Web Developer 2008 Express
I have downloaded the Visual Studio 2008 Express with SP1 All-In-One DVD image file, burned a DVD and installed Visuall Basic, with SQL Server and Visual Web Developer. However when I try to test a new site and add a  New Item/SQL Sever database I get a message: "failed to generate a user instance of SQL Server due to failure in starting the process for the user instance. The connection will be closed." I tried to use SQL Server Configuration manager and change SQLEXPRESS logon properties (different built-in account and my Windows Vista account) but it doesn't work and I ...

Error: 25
I am in VWD and went to Database Explorer to "Add Connection" to a .mdf File located on another PC on the network.  I see the following: 1) Data Source: Microsoft SQL Server (SqlClient)2) Server Name: \\ComputerName3) Log on to the Server: Use SQL Server Authentication4) Connect to a database: Attach a Database File: \\Computename\FolderName\DatabaseName.mdf5) Logical Name: [Left Blank]6) Advanced Tab: [No Changes]7) Clicked the Button: "Test Connection" Receive this Error: An error has occurred while establishing a connection to the server.  When connecting ...

Visual Studio 2008 -or- Visual Web Developer Express 2008 -or- SharePoint Designer / Etc.
It's been a while since I actively designed in dot net.  Now it's time to do some serious updating to our website (from dot net 1.1 to 3.5).  I haven't used any of the new design tools but want to be able to take complete advantage of all the new features of v3.5 and the features of development applications. What are the differences between Visual Studio 2008 / Visual Web Developer Express 2008 / SharePoint Designer / Etc. and are there any others I should consider for development?  I just want to settle on a development platform so I can start moving forward...

Visual Web Developer 2008 Express
Hi, Is it possible to integrate a Web Deployment Project into a VWD 2008 Express solution?  I installed WebDeploymentSetup.msi but my VWD 2008 Express solution won't load the Web Deployment project.  If it is not possible to do this, is there a workaround such that I can 'mimic' the functionaity of the Web Deployment Project using only VWD 2008 Express?  My basic problem right now is that my VWD 2008 Express solution is capable of building all the standard projects it contains into .dll's, but the Web Deployment project is not loaded and therefore can't ...

Visual Studio 2008 or visaul web developer express 2008?
Hi  Currently I am using the free visual web developer express 2008 software for developng asp.net and c# applications. Is there any advantages of upgrading to visual studio 2008? cheers Have a look here: http://blogs.msdn.com/mikhailarkhipov/archive/2006/06/26/647516.aspxThanks------------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no rights. ...

How to delete a web site in Visual Web Developer 2008 Express Edition
I cannot believe that I am asking a question like this. But goes... How does one delete (remove) a web site in Visual Web Developer 2008 Express Edition? I looked high and low through the menu system and the toolbars. But I could find what for me would be an obvious menu item the file menu. Feel a bit silly, but I thought I best ask. Maybe I am missing something extremely obvious. So obvious that I am blinded by it. When you create a website through VWD, the default location for saving is: My Documents\Visual Studio 2008\WebSites\AppName . You can remove the website by deleting that fo...

Which is best for web pages
Which is best to buy to develop aspx web pages. Visual Studio 2008 or Visual web developer 2008? http://forums.asp.net/p/1137916/1824119.aspx#1824119http://blogs.msdn.com/mikhailarkhipov/archive/2006/06/26/647516.aspx We All move to our original place.Don't forget.Imran Baloch Visual Web Developer of course, because it's free!! visual web developer is build into visual studio. in the free copys the desktop apps and websites are two diffrent pages. if all you are looking to do is to make a page you can download your app on make an install file and host it somwhere. ...

visual web developer 2008 express installed need upgrade vwd 2008 sp1
Hi all, any one can help me on this, i have installed visual web developer 2008 express edition on windows server 2003  R2 standard edition service pack 2 now i need to upgrade visual  web developer express edition service pack 1  when I serach i found vwd 2008 with SP1 link to download. but my question is since i have already installed VWD 2008 can I only run service pack update so that upgrade VWD 2008 to VWD 2008 with SP1. any ideas?   Yes. You can aplly the SP-1 to VWD 2008 to upgrade it from the link provided. If you have other VS Express edition programs su...

Visual Web Developer 2008 doesn't connect to SQL Server 2008 Express
 Hey everyone. I'm once again having trouble with my install of Visual Web Developer 2008 and SQL Server 2008 Express with Advanced Services on my Vista Home Premium notebook.  VWD 2008 can't seem to connect to my databases in SQL Server 2008. I use the Connect to Database feature in the Tools menu and select Microsoft SQL Server. When I get to the Add Connection window I hit refresh next to the Server name drop-down but nothing shows up. I'm completely baffled by this. What do you think is the cause of this? What are the steps i need to take to resolve this i...

Importing web parts from sharepoint services 3.0 to visual web developer express 2008
I need to know If there is a way to import the list web parts from a sharepoint server that we have onsite (running WSS 3.0) to another website not associated with sharepoint but on the same server. Im very new to sharepoint and these forums. I have worked with visual web developer 2008 express for a while now. I am pretty good with asp.net programming and i do have a copy of microsoft office sharepoint designer 2007. Can anyone elaborate on this situation....

Visual Web Dev Express 2008 and SQL server Express 2005 database connection problem
Apologies if this has already been covered, i can't find any search function on the forum. I have a somewhat annoying problem with the above software. I use Vista Home Premium x64 and have decided to install VWD 2008 and SQL2005 to learn ASP and SQL development. I only have a moderate undertanding of standard HTML and would like to expand my knowledge.  It is the final non-beta version of VWD 2008. The install went fine and no errors were shown. After trying to connect to the database via the ASP.NET application tool in VWD it gives an "unable to connect to the database ...

Web resources about - Visual Web Developer 2008 Express and MS Access 2007 - asp.net.web-dev-2008-express

Dungeons and developers
Have you ever wanted to learn web development or just refine your webdev skills? Dungeons and Developers gives your quest for knowledge a role ...

Pixel (game developer) - Wikipedia, the free encyclopedia
Amaya's other work includes the game Ikachan which he released in 2000, as well as many other low-profile games. He is currently developing a ...

Tribunal rules that developer Michael Koundouris should fix Manhatten apartment building
Michael Koundouris says he will appeal a decision regarding a leaky apartment building. Canberra developer Michael Koundouris has lost his case ...

Developers propose demolishing Braddon commercial block for apartments
If approved, residents in the 170-apartment Braddon complex would have the future light rail on their doorstep.

Tribunal rules that developer Michael Koundouris should fix Manhattan apartment building
Michael Koundouris says he will appeal a decision regarding a leaky apartment building. Canberra developer Michael Koundouris has lost his case ...

Epic Games Launches Unreal Match 3 to Help Developers Make Games
... 4 (UE4). While the game is available for users to play as a traditional game, it was built to be a learning resource to help aspiring developers ...

Oculus shipping final Rift hardware to developers starting this week
... release last night, Facebook-owned Oculus announced that it will begin shipping final, complete versions of its Oculus Rift VR headset to developers ...

Oculus is sending developers the finished version of its virtual reality headset
Oculus is sending developers the finished version of its Rift headset, according to a blog post . The shipments, which will be made this week, ...

Indian Solar Power Developer Azure Power Files For NYSE Listing
One of India’s leading solar power project developers, Azure Power, is looking at equity markets to raise funds to expand generation capacity. ...

IDG Contributor Network: Bubble, Bubble, ending the developer struggle?
For years now, I've been getting pitches from companies that promised to make application development as easy as finger painting. Instead of ...

Resources last updated: 1/4/2016 6:50:20 AM