我需要这个问题的快速答案 [英] i need quick answer for the question
本文介绍了我需要这个问题的快速答案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是编程新手..我试图为我的办公室创建计费系统..我正在使用访问数据库.我想知道如何添加,更新,删除数据.请使用代码或类似的示例帮助我.
i am new to programming.. I trying to create billing system for my office.. I am using access database. i want to know how to add,update,delete data. pls help me with a code or any example which is similar .
推荐答案
访问此链接
http://www.setha.info/ict-vb2008/43-ict-vb2008- 0011.html [ ^ ]
visit this link
http://www.setha.info/ict-vb2008/43-ict-vb2008-0011.html[^]
尝试使用此链接,您将有足够的输入来启动您的项目,
http://www.itwriting.com/pcw/vbdotnetdata.php [插入,更新,删除和删除带有VB.NET 2005的MS Access 2003中的搜索值 [ http://www.homeandlearn.co.uk/net/nets12p1.html [ ^ ]
http://support.microsoft.com/kb/821765 [ http://www.homeandlearn.co.uk/NET/vbNET.html [ ^ ]
希望这会有所帮助.
欢呼
Try this links, you will have enough inputs to start your project,
http://www.itwriting.com/pcw/vbdotnetdata.php[^]
Insert, Update, Delete & Search Values in MS Access 2003 with VB.NET 2005[^]
http://www.homeandlearn.co.uk/net/nets12p1.html[^]
http://support.microsoft.com/kb/821765[^]
http://www.homeandlearn.co.uk/NET/vbNET.html[^]
Hope this helps.
cheers
这里是一个例子
Here is an example
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Path.GetDirectoryName(Application.ExecutablePath) + "\\NBS.mdb;");
OleDbCommand cmd;
string strSQL1 = ("insert into DailyTrans_Master (ReceiptNo,ReceiptDate,Cust_ID,Amt_paid,ForMonth,ForYear)");
strSQL1 += ("values (''" + txtReceiptNo.Text + "'',Date()," + txtCustomerID.Text + "," + txtAmt.Text + ",''" + cmbMonth.Text + "'',''" + cmbYear.Text + "'')");
con.Open();
cmd = new OleDbCommand(strSQL1, con);
cmd.ExecuteNonQuery();
con.Close();
string strSQL = "update Receipt_Master_" + cmbYear.Text + " set [Jan]= " + txtAmt.Text + " where [Cust_ID]= " + txtCustomerID.Text + "";
con.Open();
cmd = new OleDbCommand(strSQL, con);
cmd.ExecuteNonQuery();
con.Close();
string SQL = "delete from area_master where area_Name = ''" + txtAreaName.Text + "'' and area_Code = ''" + txtAreaCode.Text + "''";
con.Open();
cmd = new OleDbCommand(SQL, con);
cmd.ExecuteNonQuery();
con.Close();
这篇关于我需要这个问题的快速答案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文