database - C# error: The type or namespace name '' could not be found, checked framework -
Databases do not use, I have followed all these steps.
I'm trying to connect an MS Acces database with my windowsformapication. All the frameworks are on 4 customer profiles.
The type or namespace name 'Dataselag' was not found (Do you use Usage Director Or are not forgetting assembly references?)
Getting this error, using the database; I can not be found in my second code ... I do not know why ...
This is my database code
using the system; Using System.Collections.Generic; Using System.Text; Using System.Data; Using System.Data.OleDb; Namespace DatabaseBase {Public Class DBaccess {Private Static String connectionstr; Stable dbxus () {string mdffile; Mdffile = @ "C: \ User Rike \ Documents \ Visual Studio 2010 \ Projects \ Week-2-ODPratch \ Database \ ClientNACCDDB"; Connectionstr = @ "Provider = Microsoft.ACE.OLEDB.12.0; Data Source = '" + mdffile + "'"; } Public stable dataset gatewark query (string sqlstr) {dataset DS = new dataset (); Console.WriteLine (sqlstr); OleDbConnection con = new OleDbConnection (connectionstr); OleDbDataAdapter dap = New OleDbDataAdapter (sqlstr, con); Dap.fill (ds); Return ds; } Public static int Uitvoerenquery (string sqlstr) {int resultaat = -1; Console.WriteLine (sqlstr); OleDbConnection con = new OleDbConnection (connectionstr); ODDB Commands CMD = new OLEDB Commands (sqlstr, conn); Try {con.Open (); Resultaat = cmd.ExecuteNonQuery (); } Hold (exception XP) {string x = exp.Message; } Finally {if (con.State == ConnectionState.Open) {con.Close (); }} Return result; }} And this is the client code, I want to link the database with this code
using the system; Using System.Collections.Generic; Using System.Linq; Using System.Text; Week_2_operrader_model; Using System.Data.OleDb; Using System.Data; Using Databazel; Namespace Week_2_ApperDrodmodel {PUBLIC class classname {public static list & lt; Customers & gt; _clientenlijst = New list & lt; Client & gt; (); Public Client () {VulClientObjecten (); } // IIC Dummy has zero geographical position VulClientObjecten () {client client; Int i; For (i = 1; i & lt; = 25; i ++) {client = new client (/ * "nimer * / i," voranam "," achantam ", / * man / vrouw * / true, * Leftijid * / 25 + (i * 2), "Woonplaats"); _clientenlijst.Add (customer);}} // public static void VoegClientToe (creating client customer) {_clientenlijst.Add (customer);} public static customer ZoekClient read // (int clientNummer) {foreach (customer) in _clientenlijst {if (client.Nummer == clientNummer) {return customer;}} new client return ();} delete // public static void VerwijderClient (integer clientNummer) { Client Clients = ZoekClient (clientNummer); _clientenlijst.Remove (Customer); Console.WriteLine (Gr E);} // update public static void UpdateClient (ClientNummer integer, string voorNaam, string achterNaam, bool geslacht, age, string woonPlaats int) {VerwijderClient (clientNummer); client = new Client (clientNummer, voorNaam, achterNaam, geslacht, Age, woonPlaats); VoegClientToe (customer);} public static void VerwijderClient (integer clientNummer, string voorNaam, strin G achterNaam, bool geslacht, int leefTijd, string Woonplats) {client = ZoekClient (clientNummer); _clientenlijst.Remove (customer); Console.WriteLine (customer); }} Is there anyone who knows what's happening?
Did you enter Databases on your Week_2_Opdracht_MODEL project Have a reference in?
Comments
Post a Comment