ÎÒʹÓÃÁËsharpdevelop×öѧϰ£¡ÔÚdata¹¤¾ß¿¨ÖÐÖ»ÓÐÁÈÁȼ¸¸ö
Óûä¯ÀÀmssqlÊý¾Ý¿âtestÖÐijһÕÅ±í¡£Ã²ËÆû·¢ÏÖɶ¿Ø¼þ¡£ÓÃÁËviewºÍsourceµÄ¡£
ûÓÐÉèÖõĵط½£¬¿¨ÔÚÕâÀï´ó¸ÅºÃ¼¸¸öСʱÁË¡£baidugooleÎÞ¹û¡£
À´Ñ°Çó´ïÈË°ïÖú
mssqlÀïµÄtest¿âÀïµÄtabletest±íÀïÓÐname×ֶκÍage×Ö¶Î
¸ñʽÊÇ
name age
СÍõ 15
ÕÅÈý 20
Ï£Íû´ïÈËÖ¸½ÌÈçºÎͨ¹ýʹÓÃ
C# code:
SqlConnection con = new SqlConnection();
con.ConnectionString="server=127.0.0.1;database=test;uid=sa;pwd=2150255;";
con.Open();
string sql="select * from tabletest";
µÈÓï¾äʵÏÖ
Õâ¸öЧ¹û
µ¯³öÕâЩÊý¾Ý£¡
ͬʱÎÊһϡ£Visual studioÀïÓпìËÙµÄÉèÖõÄÂ
»òÕ߸æËßÎÒsharpdevelopÀïÈçºÎ¿ìËÙͨ¹ýÉèÖÃdatagridview¿ìËÙä¯ÀÀÊý¾Ý¿âÄØ£¿
100·ÖСÈâ²»³É¾´ÒâΪÄú·îÉÏ£¡
sharpdevelop
ÕⶫÎ÷ûÓùý,ºÇºÇ
ûÓùý¡£
·ÅÊÇDataGrid,ÔÚÍÏÒ»¸öBindSource³öÀ´.
ÉèÖÃDataGride µÄÊý¾ÝÔ´. ÔËÐм´¿É¿´µ½Êý¾Ý
¶¥~
ʹÓÃbindingSource
String connectionString =""£»
dataAdapter = new SqlDataAdapter(selectCommand, connectionString);
SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);
DataTable dt= new DataTable();
dataAdapter.Fill(dt);
bindingSource1.DataSource = dt;
ÒòϵͳÐèÇ󣬽«Í¼Ïñ·ÅÈëmssqlÖУ¬×Ö¶ÎÀàÐÍΪblob£¬Í¼ÏñΪjpgÀàÐÍ£¬ÈçÏ´úÂëÖ´ÐÐʱ²¢²»ÄÜÕýÈ·Êä³öͼÏñ£¬Âé·³¸÷λ°ï濴һϣ¬·Ç³£¸Ðл!!
<?php
include_once("db.class.php");
// retr ......