472,353 Members | 2,237 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 2796
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***@videotron.ca> wrote in message
news:ec********************@weber.videotron.net...
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***@videotron.ca> wrote in message
news:ec********************@weber.videotron.net...
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@_spamkiller_bobpowell.net> wrote in message
news:u6**************@TK2MSFTNGP09.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***@videotron.ca> wrote in message
news:ec********************@weber.videotron.net...
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.ConnectionString(this.Se rver));

OleDbDataAdapter da=new OleDbDataAdapter("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("INSERT INTO products(product_name, stock, minstock,
price, content, category, description) VALUES(?,?,?,?,?,?,?);",cnx);

cmd.Parameters.Add("product_name",OleDbType.Char). Value=this.name.Text;

cmd.Parameters.Add("stock",OleDbType.Integer).Valu e=int.Parse(this.stock.Text);

cmd.Parameters.Add("minstock",OleDbType.Integer).V alue=int.Parse(this.minstock.Text);

cmd.Parameters.Add("price",OleDbType.Currency).Val ue=decimal.Parse(this.price.Text);

cmd.Parameters.Add("content",OleDbType.Integer).Va lue=content;

cmd.Parameters.Add("category",OleDbType.Integer).V alue=int.Parse(this.DropDownList1.SelectedValue.To String());

cmd.Parameters.Add("description",OleDbType.Integer ).Value=description;

cmd.ExecuteNonQuery();

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

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

cmd.Parameters.Add("product_name",OleDbType.Char). Value=this.name.Text;

cmd.Parameters.Add("stock",OleDbType.Integer).Valu e=int.Parse(this.stock.Text);

cmd.Parameters.Add("minstock",OleDbType.Integer).V alue=int.Parse(this.minstock.Text);

cmd.Parameters.Add("price",OleDbType.Currency).Val ue=decimal.Parse(this.price.Text);

cmd.Parameters.Add("content",OleDbType.Integer).Va lue=(int)ViewState["content"];

cmd.Parameters.Add("category",OleDbType.Integer).V alue=this.DropDownList1.SelectedValue;

cmd.Parameters.Add("description",OleDbType.Integer ).Value=ViewState["description"];

cmd.Parameters.Add("i",OleDbType.Integer).Value=it em;

cmd.ExecuteNonQuery();

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***@videotron.ca> wrote in message
news:Oi********************@wagner.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@_spamkiller_bobpowell.net> wrote in message
news:u6**************@TK2MSFTNGP09.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***@videotron.ca> wrote in message
news:ec********************@weber.videotron.net...
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@_spamkiller_bobpowell.net> wrote in message
news:el**************@TK2MSFTNGP15.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.ConnectionString(this.Se rver));

OleDbDataAdapter da=new OleDbDataAdapter("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("INSERT INTO products(product_name, stock, minstock,
price, content, category, description) VALUES(?,?,?,?,?,?,?);",cnx);

cmd.Parameters.Add("product_name",OleDbType.Char). Value=this.name.Text;

cmd.Parameters.Add("stock",OleDbType.Integer).Valu e=int.Parse(this.stock.Text);

cmd.Parameters.Add("minstock",OleDbType.Integer).V alue=int.Parse(this.minstock.Text);

cmd.Parameters.Add("price",OleDbType.Currency).Val ue=decimal.Parse(this.price.Text);

cmd.Parameters.Add("content",OleDbType.Integer).Va lue=content;

cmd.Parameters.Add("category",OleDbType.Integer).V alue=int.Parse(this.DropDownList1.SelectedValue.To String());

cmd.Parameters.Add("description",OleDbType.Integer ).Value=description;

cmd.ExecuteNonQuery();

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

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

cmd.Parameters.Add("product_name",OleDbType.Char). Value=this.name.Text;

cmd.Parameters.Add("stock",OleDbType.Integer).Valu e=int.Parse(this.stock.Text);

cmd.Parameters.Add("minstock",OleDbType.Integer).V alue=int.Parse(this.minstock.Text);

cmd.Parameters.Add("price",OleDbType.Currency).Val ue=decimal.Parse(this.price.Text);

cmd.Parameters.Add("content",OleDbType.Integer).Va lue=(int)ViewState["content"];

cmd.Parameters.Add("category",OleDbType.Integer).V alue=this.DropDownList1.SelectedValue;

cmd.Parameters.Add("description",OleDbType.Integer ).Value=ViewState["description"];

cmd.Parameters.Add("i",OleDbType.Integer).Value=it em;

cmd.ExecuteNonQuery();

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***@videotron.ca> wrote in message
news:Oi********************@wagner.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@_spamkiller_bobpowell.net> wrote in message
news:u6**************@TK2MSFTNGP09.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***@videotron.ca> wrote in message
news:ec********************@weber.videotron.net...
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
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...
4
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...
0
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. ...
1
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
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...
5
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 ...
3
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...
2
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...
3
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...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.