Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VistaDB 2.0 released
Message
From
22/10/2004 01:49:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00950328
Message ID:
00953625
Views:
13
Hi Gerard,
Sorry for the delay I've been very busy and still is. Here is a quick outline that would give the idea:
// 
// oleDbVFPDataAdapter
// 
this.oleDbVFPDataAdapter.ContinueUpdateOnError = true;
this.oleDbVFPDataAdapter.DeleteCommand = this.myDeleteCmd;
this.oleDbVFPDataAdapter.InsertCommand = this.myInsertCmd;
this.oleDbVFPDataAdapter.SelectCommand = this.mySelectCmd;
this.oleDbVFPDataAdapter.UpdateCommand = this.myUpdateCmd;
this.oleDbVFPDataAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {...});

// 
// myDeleteCmd
// 
this.myDeleteCmd.CommandText = "DELETE FROM customer WHERE cust_id = ?";
this.myDeleteCmd.Connection = this.oleDbVFPConn;
this.myDeleteCmd.Parameters.Add(new System.Data.OleDb.OleDbParameter("Cust_id",
   System.Data.OleDb.OleDbType.VarChar, 6, 
   System.Data.ParameterDirection.Input, false, 
  ((System.Byte)(0)), ((System.Byte)(0)), "Cust_id", System.Data.DataRowVersion.Original, null));

// 
// myInsertCmd
// 
this.myInsertCmd.CommandText = "INSERT INTO customer (company, contact, title, address, city,"+
    "region, postalcode, country, phone, fax, maxordamt, cust_id)"+
    " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, )";
this.myInsertCmd.Connection = this.oleDbVFPConn;
this.myInsertCmd.Parameters.Add(
  new System.Data.OleDb.OleDbParameter("company", 
  System.Data.OleDb.OleDbType.VarChar, 40, "company"));
// ... other parameters in same ORDER as they appear in CommandText
this.myInsertCmd.UpdatedRowSource = System.Data.UpdateRowSource.None;

// 
// mySelectCmd
// 
this.mySelectCmd.CommandText = "SELECT cust_id, company, contact, title, address, city,"+
   "region, postalcode, country, phone, fax, maxordamt, mylongfieldname FROM customer";
this.mySelectCmd.Connection = this.oleDbVFPConn;
// 
// myUpdateCmd
// 
this.myUpdateCmd.CommandText = "UPDATE customer SET company = ?, contact = ?, title = ?,"+
 " address = ?, city = ?, region = ?, postalcode = ?, country = ?, phone = ?,"+
 " fax = ?, maxordamt = ? WHERE cust_id = ?";
this.myUpdateCmd.Connection = this.oleDbVFPConn;
this.myUpdateCmd.Parameters.Add(
  new System.Data.OleDb.OleDbParameter("company", 
  System.Data.OleDb.OleDbType.VarChar, 40, "company"));
// ... other parameters in same ORDER as they appear in CommandText
Cetin

>Hi Cetin.
>I'd appreciate any code like that once you get a chance.
>
>I've juat started to use .Net but find it amazing that there are problems with VFP in thsi area.....net is out now about 3 years and I would have thought any of these (which seem fairly fundamnetal to me) should have been sorted out ages ago !!
>
>Regards,
>
>Gerard
>
>
>>I see what you mean.
>>I don't use any frameworks and can easily define mine insert,update,delete commands (yes .NET autogeneration of these commands do not work but it might be .NET's fault - I don't know).
>>If I don't forget and reach to my work computer might post a sample.
>>Cetin
>>
>>>Hi Cetin.
>>>
>>>it would seem that the Insert,Delete and Update commands dont get properly formulated. I have just started to play aroundwith MM framework .
>>>My main goal was to try and design apps where the Back End could be changed by modifying a 'Parameter File', to change the Type of Database, without chaging any of the actual code.
>>>
>>>The MM framework seems to be ideal for this , because it is structured in such a way that the Connection strings are held in App.config file.
>>>
>>>However, for a very simple Maintenance screen, the VFP Ole DB provider has probelems generating delete command... thats as far as I've got so far.
>>>
>>>Regards,
>>>
>>>Gerard
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Gerard,
>>>>It's not as good as SQLserver OLEDB but in general it turns out to be wrong usage of .NET code (there are few areas that doesn't work right but most of them have simple workarounds).
>>>>What's that not working right?
>>>>Cetin
>>>>
>>>>>Hi Anthony.
>>>>>
>>>>>Is there an OLEDB driver that works for VIstaDB .
>>>>>I've jsut started to use .Net with the OLE DB driver for VFP . ans it seems that there are certain areas that this OLEDB driver just does not work correctly .
>>>>>
>>>>>Regards,
>>>>>
>>>>>Gerard
>>>>>
>>>>>
>>>>>
>>>>>>Hi Kevin,
>>>>>>
>>>>>>> -Does VistaDB support stored procedures?
>>>>>>
>>>>>>Not in 2.0. We plan to host the CLR in 3.0, due out in early 2005.
>>>>>>This will work much like Yukon.
>>>>>>
>>>>>>> -Does it support temp tables?
>>>>>>
>>>>>>Yes. You can create in-memory tables and physical temporary tables.
>>>>>>Just so you know, VistaDB is much closer to Jet than to the MSDE
>>>>>>
>>>>>>> -Does it support UDFs?
>>>>>>
>>>>>>No.
>>>>>>
>>>>>>> -How closely does it support the SQL-92 standard?
>>>>>>> In particular, I have instances where I return a scalar result from a subquery
>>>>>>
>>>>>>Quite closely. And yes, you can use scalers.
>>>>>>
>>>>>>> It does seem like a good alternative for instances where one wants a
>>>>>>> small footprint - and if it supports those things, I might be able to use it.
>>>>>>
>>>>>>That's exactly the goal: VistaDB is designed to be an alternative to Jet.
>>>>>>Just so you know, we've been working on VistaDB for 3+ years (4 guys at
>>>>>>our company) and its based on many years of experience working on commercial
>>>>>>data engines. The VistaDB eval we have for download is full featured so you
>>>>>>can see first hand if VistaDB would be a good solution for some of your projects.
>>>>>>
>>>>>>
>>>>>>Anthony Carrabino
>>>>>>www.vistadb.net
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform