c#ÊÂÎñ»Ø¹ö
c#ÊÂÎñ»Ø¹ö£¨×ª£©
×÷Õߣºxue5ya À´Ô´£º²©¿ÍÔ° ·¢²¼Ê±¼ä£º2009-03-20 16:08 ÔĶÁ£º263 ´Î ÔÎÄÁ´½Ó [ÊÕ²Ø]
Code
public void UpdateContactTableByDataSet(DataSet ds,string strTblName)
{
try
{
string strConnection ="server = ;database = ;uid = ;pwd = ;Connec Timeout = 60 ";
SqlDataAdapter myAdapter = new SqlDataAdapter();
SqlConnection conn = new SqlConnection(strConnection);
SqlCommand myCommand = new SqlCommand("select * from strTblName",conn);
myAdapter.SelectCommand = myCommand;
SqlCommandBuilder myCommandBuilder = new SqlCommandBuilder(myAdapter);
conn.Open();
SqlTransaction myTrans = conn.BeginTransaction();
myCommand.Transaction = myTrans;
try
{
myAdapter.Update(ds,strTblName);
myTrans.Commit();
}
 
Ïà¹ØÎĵµ£º
Ê×ÏÈдһ¸öÒ³Ãæ£¬ÉÏÃæÒª·ÅÒ»¸öButton
<html>
<head>
<title></title>
</head>
<body>
<input id="Button1" type="button" value="button" />
</body>
</html>
½«Æä±£´ ......
Ò»¡¢Access´ÓExcelÖе¼ÈëÊý¾Ý
1.Óõ½µÄExcel±íµÄ¸ñʽ¼°ÄÚÈÝ
ʵÏÖ
OleDbConnection con = new OleDbConnection();
try
{
OpenFileDialog openFile = new OpenFileDialog();//´ò¿ªÎļþ¶Ô»°¿ò¡£
openFile.Filter = ("Excel Îļþ(*.xls)|*.xls") ......
²úÆ·¼¸ÄêǰʹÓÃASP£¬ºóÀ´Éý¼¶µ½.Net 1.1£¬ÔÙÉý¼¶µ½2.0£¬Ò»Ö±¶¼ÓÐÓÃXSLTת»»XMLÉú³ÉÍøÒ³µÄ·½Ê½£¬ÉÔ΢ÕûÀíÏ¡£
XML file:
<?xml version="1.0" encoding="utf-8" ?>
<ric>
<catalog>
<book price ......
Ò»£®ÀàÓë½á¹¹µÄʾÀý±È½Ï£º
½á¹¹Ê¾Àý£º
public struct Person
{
string Name;
int height;
int weight
public bool overWeight()
{
//implement something
}
}
ÀàʾÀý£º
public class TestTime
{
int hours;
int minutes;
int seconds;
public void passtime()
{
//implementation ......
1. newÓм¸ÖÖÓ÷¨
3ÖÖ ÊµÀý¶ÔÏó ·½·¨Òþ²Ø
2.ÈçºÎ°ÑÒ»¸öarray¸´ÖƵ½arrayListÀï
foreach( object o in array )arrayList.Add(o);
3.datagrid.datasouse¿ÉÒÔÁ¬½ÓʲôÊý¾ÝÔ´
Êý¾Ý¼¯DataSet
4.¸ÅÊö·´ÉäºÍÐòÁл¯
¶¯Ì¬»ñµÃ ......