473,562 Members | 3,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I want to create a database and store and retrieve information

Hi,

I am used to working in Visual FoxPro and I would like to be able to create
a database and store and retrieve information from it. What is the simplest
way to do it and what should I be using as there are many choices to choose
from.

My database will contain a lot of records.

TIA
Roy
Nov 17 '05 #1
5 2918
Hello,
There are many possibilities. You can use SQLServer or Access, If you want
to go cheap there are alternatives such as MySQL that have C# or Visual
Basic wrappers.

Probably more attractive to you is the fact that VFP can be automated via
COM. Therefore you can write VB or C# applications that use the database
engine you're most familiar with.

You'd really be petter asking these questions over in a VFP group I guess.

Oh... have you seen this??
http://foxcentral.net/microsoft/NETforVFPDevelopers.htm

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:ec******** ************@we ber.videotron.n et...
Hi,

I am used to working in Visual FoxPro and I would like to be able to
create a database and store and retrieve information from it. What is the
simplest way to do it and what should I be using as there are many choices
to choose from.

My database will contain a lot of records.

TIA
Roy

Nov 17 '05 #2
And this....

http://www.gotdotnet.com/team/vfp

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:ec******** ************@we ber.videotron.n et...
Hi,

I am used to working in Visual FoxPro and I would like to be able to
create a database and store and retrieve information from it. What is the
simplest way to do it and what should I be using as there are many choices
to choose from.

My database will contain a lot of records.

TIA
Roy

Nov 17 '05 #3
Hi,

Thanks for replying.

I think I will break ties with FoxPro and COM and go for either SQLServer or
Access. There seems to be a lot more support for SQLServer than Access, so I
think that I will try SQLServer. What do I have to do to get SQLServer and
which version should I be using. Or is SQLServer already part of the VS.Net?

All I really need is to store and retrieve information from a database. What
do you recommend and are there any examples?

TIA
Roy
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:u6******** ******@TK2MSFTN GP09.phx.gbl...
Hello,
There are many possibilities. You can use SQLServer or Access, If you want
to go cheap there are alternatives such as MySQL that have C# or Visual
Basic wrappers.

Probably more attractive to you is the fact that VFP can be automated via
COM. Therefore you can write VB or C# applications that use the database
engine you're most familiar with.

You'd really be petter asking these questions over in a VFP group I guess.

Oh... have you seen this??
http://foxcentral.net/microsoft/NETforVFPDevelopers.htm

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:ec******** ************@we ber.videotron.n et...
Hi,

I am used to working in Visual FoxPro and I would like to be able to
create a database and store and retrieve information from it. What is the
simplest way to do it and what should I be using as there are many
choices to choose from.

My database will contain a lot of records.

TIA
Roy


Nov 17 '05 #4
VS has a developer version of SQL server which is OK for developing apps
that you can test out.

Storing and retrieving data is as simple ad writing the SQL statements that
manipulate the tables. I don't know anything about FoxPro so, to be honest,
I don't even know if it does SQL.

Because I'm a cheapskate I often use access databases or MySQL. SQL server
is really an option for a company that can afford the license fees. It's by
far the best choice but one needs to be committed to a certain level of
monetary outlay.

Here for example is a simple set of commands I used to populate a repeater
on a website I did a while back. It uses Access...

DataSet ds=new DataSet();

OleDbConnection cnx=new
OleDbConnection (Constants.Conn ectionString(th is.Server));

OleDbDataAdapte r da=new OleDbDataAdapte r("SELECT * FROM content",cnx);

da.Fill(ds);

this.Repeater1. DataSource=ds;

this.Repeater1. DataBind();

That was a pretty simple one. The Constants class just lets me get a
connection string according to whether i'm in debug mode so the connection
string points to my local access database file or in release mode in which
case it uses Server.MapPath to get to where my DB is stored.

Here's me adding a record to a table...

cmd=new OleDbCommand("I NSERT INTO products(produc t_name, stock, minstock,
price, content, category, description) VALUES(?,?,?,?, ?,?,?);",cnx);

cmd.Parameters. Add("product_na me",OleDbType.C har).Value=this .name.Text;

cmd.Parameters. Add("stock",Ole DbType.Integer) .Value=int.Pars e(this.stock.Te xt);

cmd.Parameters. Add("minstock", OleDbType.Integ er).Value=int.P arse(this.minst ock.Text);

cmd.Parameters. Add("price",Ole DbType.Currency ).Value=decimal .Parse(this.pri ce.Text);

cmd.Parameters. Add("content",O leDbType.Intege r).Value=conten t;

cmd.Parameters. Add("category", OleDbType.Integ er).Value=int.P arse(this.DropD ownList1.Select edValue.ToStrin g());

cmd.Parameters. Add("descriptio n",OleDbType.In teger).Value=de scription;

cmd.ExecuteNonQ uery();

and here's me updating a table with some changed data...

OleDbCommand cmd=new OleDbCommand("U PDATE products SET product_name=?,
stock=?, minstock=?, price=?, content=?, category=?, description=? WHERE
productid=[i];",cnx);

cmd.Parameters. Add("product_na me",OleDbType.C har).Value=this .name.Text;

cmd.Parameters. Add("stock",Ole DbType.Integer) .Value=int.Pars e(this.stock.Te xt);

cmd.Parameters. Add("minstock", OleDbType.Integ er).Value=int.P arse(this.minst ock.Text);

cmd.Parameters. Add("price",Ole DbType.Currency ).Value=decimal .Parse(this.pri ce.Text);

cmd.Parameters. Add("content",O leDbType.Intege r).Value=(int)V iewState["content"];

cmd.Parameters. Add("category", OleDbType.Integ er).Value=this. DropDownList1.S electedValue;

cmd.Parameters. Add("descriptio n",OleDbType.In teger).Value=Vi ewState["descriptio n"];

cmd.Parameters. Add("i",OleDbTy pe.Integer).Val ue=item;

cmd.ExecuteNonQ uery();

As you can see it's all pretty straightforward . Even I can manage it :-)
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:Oi******** ************@wa gner.videotron. net...
Hi,

Thanks for replying.

I think I will break ties with FoxPro and COM and go for either SQLServer
or Access. There seems to be a lot more support for SQLServer than Access,
so I think that I will try SQLServer. What do I have to do to get
SQLServer and which version should I be using. Or is SQLServer already
part of the VS.Net?

All I really need is to store and retrieve information from a database.
What do you recommend and are there any examples?

TIA
Roy
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:u6******** ******@TK2MSFTN GP09.phx.gbl...
Hello,
There are many possibilities. You can use SQLServer or Access, If you
want to go cheap there are alternatives such as MySQL that have C# or
Visual Basic wrappers.

Probably more attractive to you is the fact that VFP can be automated via
COM. Therefore you can write VB or C# applications that use the database
engine you're most familiar with.

You'd really be petter asking these questions over in a VFP group I
guess.

Oh... have you seen this??
http://foxcentral.net/microsoft/NETforVFPDevelopers.htm

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:ec******** ************@we ber.videotron.n et...
Hi,

I am used to working in Visual FoxPro and I would like to be able to
create a database and store and retrieve information from it. What is
the simplest way to do it and what should I be using as there are many
choices to choose from.

My database will contain a lot of records.

TIA
Roy



Nov 17 '05 #5
Hi Bob,

Yes Foxpro does have SQL but I never did use it myself.

Thanks very helpful. It seems like you really have to do a lot of work just
to add a record in a table. In Foxpro it is so much easier as you do it all
in one statement with ease. :)

Roy

"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:el******** ******@TK2MSFTN GP15.phx.gbl...
VS has a developer version of SQL server which is OK for developing apps
that you can test out.

Storing and retrieving data is as simple ad writing the SQL statements
that manipulate the tables. I don't know anything about FoxPro so, to be
honest, I don't even know if it does SQL.

Because I'm a cheapskate I often use access databases or MySQL. SQL server
is really an option for a company that can afford the license fees. It's
by far the best choice but one needs to be committed to a certain level of
monetary outlay.

Here for example is a simple set of commands I used to populate a repeater
on a website I did a while back. It uses Access...

DataSet ds=new DataSet();

OleDbConnection cnx=new
OleDbConnection (Constants.Conn ectionString(th is.Server));

OleDbDataAdapte r da=new OleDbDataAdapte r("SELECT * FROM content",cnx);

da.Fill(ds);

this.Repeater1. DataSource=ds;

this.Repeater1. DataBind();

That was a pretty simple one. The Constants class just lets me get a
connection string according to whether i'm in debug mode so the connection
string points to my local access database file or in release mode in which
case it uses Server.MapPath to get to where my DB is stored.

Here's me adding a record to a table...

cmd=new OleDbCommand("I NSERT INTO products(produc t_name, stock, minstock,
price, content, category, description) VALUES(?,?,?,?, ?,?,?);",cnx);

cmd.Parameters. Add("product_na me",OleDbType.C har).Value=this .name.Text;

cmd.Parameters. Add("stock",Ole DbType.Integer) .Value=int.Pars e(this.stock.Te xt);

cmd.Parameters. Add("minstock", OleDbType.Integ er).Value=int.P arse(this.minst ock.Text);

cmd.Parameters. Add("price",Ole DbType.Currency ).Value=decimal .Parse(this.pri ce.Text);

cmd.Parameters. Add("content",O leDbType.Intege r).Value=conten t;

cmd.Parameters. Add("category", OleDbType.Integ er).Value=int.P arse(this.DropD ownList1.Select edValue.ToStrin g());

cmd.Parameters. Add("descriptio n",OleDbType.In teger).Value=de scription;

cmd.ExecuteNonQ uery();

and here's me updating a table with some changed data...

OleDbCommand cmd=new OleDbCommand("U PDATE products SET product_name=?,
stock=?, minstock=?, price=?, content=?, category=?, description=? WHERE
productid=[i];",cnx);

cmd.Parameters. Add("product_na me",OleDbType.C har).Value=this .name.Text;

cmd.Parameters. Add("stock",Ole DbType.Integer) .Value=int.Pars e(this.stock.Te xt);

cmd.Parameters. Add("minstock", OleDbType.Integ er).Value=int.P arse(this.minst ock.Text);

cmd.Parameters. Add("price",Ole DbType.Currency ).Value=decimal .Parse(this.pri ce.Text);

cmd.Parameters. Add("content",O leDbType.Intege r).Value=(int)V iewState["content"];

cmd.Parameters. Add("category", OleDbType.Integ er).Value=this. DropDownList1.S electedValue;

cmd.Parameters. Add("descriptio n",OleDbType.In teger).Value=Vi ewState["descriptio n"];

cmd.Parameters. Add("i",OleDbTy pe.Integer).Val ue=item;

cmd.ExecuteNonQ uery();

As you can see it's all pretty straightforward . Even I can manage it :-)
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:Oi******** ************@wa gner.videotron. net...
Hi,

Thanks for replying.

I think I will break ties with FoxPro and COM and go for either SQLServer
or Access. There seems to be a lot more support for SQLServer than
Access, so I think that I will try SQLServer. What do I have to do to get
SQLServer and which version should I be using. Or is SQLServer already
part of the VS.Net?

All I really need is to store and retrieve information from a database.
What do you recommend and are there any examples?

TIA
Roy
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:u6******** ******@TK2MSFTN GP09.phx.gbl...
Hello,
There are many possibilities. You can use SQLServer or Access, If you
want to go cheap there are alternatives such as MySQL that have C# or
Visual Basic wrappers.

Probably more attractive to you is the fact that VFP can be automated
via COM. Therefore you can write VB or C# applications that use the
database engine you're most familiar with.

You'd really be petter asking these questions over in a VFP group I
guess.

Oh... have you seen this??
http://foxcentral.net/microsoft/NETforVFPDevelopers.htm

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:ec******** ************@we ber.videotron.n et...
Hi,

I am used to working in Visual FoxPro and I would like to be able to
create a database and store and retrieve information from it. What is
the simplest way to do it and what should I be using as there are many
choices to choose from.

My database will contain a lot of records.

TIA
Roy



Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1308
by: Ian | last post by:
On the web site: (www.mvps.org/access/) I found a lovely piece of code that retrieves the operating systems name, build number, service pack etc. Is there something similar to retrieve information about MS Access that would return something like: Access 97 Service Pack 1 Regards
4
2800
by: Nanda | last post by:
hi, how to create database in mssql server using c#. We can create msacess database using adox, similiarly how to create sql server database using c#. Regards, Nanda.
0
3094
by: SampathTangudu | last post by:
Hi, We are trying to use the Hash Tables for passing information from one aspx page to another aspx page. We are using the below code. IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore( IsolatedStorageScope.User | IsolatedStorageScope.Assembly |IsolatedStorageScope.Domain , null, null );
1
1169
by: Connull | last post by:
How do I retrieve the Customer Information and Serial Number used after my Application has been Installed (as per Visual Studio .NET splash screen)
2
3763
by: Anantha | last post by:
Dear All, One day our Windows 2000 Server OS crashed, so our NT admin has re-installed the OS on C: drive. Fortunately we kept our database file and installation in F: drive. When we re-installed DB2 on the same location we are able to catalog and recover the database with old data files. Now the problem is when i tried to create a database...
5
3071
by: Philip Nelson | last post by:
I get - db2inst1@dvorak /db2data $ db2 "create database DBTST001 automatic storage yes on /db2data/db2db dbpath on /db2data/db2db" SQL0805N Package "NULLID.SQLE2F0J 0X4141414141654557" was not found. SQLSTATE=51002 At least one other person on the IRC forum reports the same thing, so it isn't my install.
3
5016
by: Alfred | last post by:
I want to post text field data from these HTML TEXTAREA tags to a PostgreSQL database and have it reappear back on another page exactly as I had typed it. Over the years I have done this but only did it with simple text. This time around, I want to handle much more complex text. I need to preserve some kinds of features. (Yes, I have turned...
2
2112
by: James Wong | last post by:
Hi everybody, I would like to know how to retrieve information from AssemblyInfo.vb inside web service. I've tried many different ways including GetExecutingAssembly or similar method but all are failed. My main purpose is the version number stored in AssemblyInfo.vb. Thanks for your attention and kindly advice! Regards,
3
2394
by: mistersulu | last post by:
Hi all: I'm using a wx.ListView object with a multi-threaded wxPython app. The list is dynamically generated and accessed across two or more threads. In spite of the fact that I have checks to see if an item at a given index is in the list and the entire set of logic is contained within a try: except: block I periodically get pop-up...
0
7652
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7867
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7625
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5476
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5193
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2073
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1187
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
901
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.