datagirdviewºÍlistview,ɾ¸Ä²ésqlserverÊý¾Ý¿âµÄС½á
//´´½¨DBhelperÊý¾Ý¿âÁ´½ÓÎļþ
private static string sqlcon = "server=.;database=myschool;uid=sa;pwd=sa";
public static SqlConnection connection = new SqlConnection(sqlcon);
============================================================
//Ê×ÏÈÊÇlv¿Ø¼þµÄÁбíÏÔʾ ,(listview)
// Çå¿Õµ±Ç°lv±íÖÐÄÚÈÝ
listview.Items.Clear();
string sql = "select * from question";
//ÒýÓÃDBhelperÖеÄÊý¾Ý¿âÁ´½Ó
SqlCommand command = new SqlCommand(sql,DBhelper.connection);
//´ò¿ªÊý¾Ý¿â,²¢ÓÃdr¶ÁÈ¡¼Ç¼
DBhelper.connection.Open();
SqlDataReader dr = command.ExecuteReader();
while (dr.Read())
{
ListViewItem lvi = new ListViewItem(dr["Question"].ToString());
lvi.SubItems.AddRange(new string[] { dr["Answer"].ToString(), dr["Difficulty"].ToString(), dr["SubjectId"].ToString(), dr["OptionA"].ToString(), dr["OptionB"].ToString(), dr["OptionC"].ToString(), dr["OptionD"].ToString() });
Ïà¹ØÎĵµ£º
ÿ´Î´ò¿ªSQLServer²éѯ·ÖÎöÆ÷ºó£¬ÔÚÁ¬½Ó´°¿ÚÀïµÄSQLServer·þÎñÆ÷Ñ¡ÔñÏÂÀ¿òºÍµÇ¼Óû§ÃûÊäÈë¿òÀï¶¼»áÁôÓÐÀúÊ·µÇ¼µÄ¼Ç¼£¬ÓÐʱºòÎÒÃÇÊDz»Ï£ÍûÕâÑùµÄ£¬±ÈÈçÔÚÒ»¸ö·Ç˽ÓÐÁìµØ×öÁËÔÝʱµÄ¿ª·¢ºó£¬²»ÏëÁôÏÂÈκÎÁ¬½ÓÔ¶³ÌÊý¾Ý¿âµÄ¼Ç¼£¬ÈçºÎɾ³ýÄØ£¿»¹ÊÇ×¢²á±í£¬ÕÒµ½ÒÔÏ·¾¶£º
HKEY_CURRENT_USER\Software\Microsoft\Microsoft&n ......
using System.Data.SqlClient;
using System.Data.OleDb;
private void button1_Click(object sender, EventArgs e)
{
OleDbConnection conn = null;
try
&nbs ......
SQLServerʱ¼äÈÕÆÚº¯ÊýÏê½â,SQLServer,ʱ¼äÈÕÆÚ,
1. µ±Ç°ÏµÍ³ÈÕÆÚ¡¢Ê±¼ä
select getdate()
2. dateadd ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØÐ嵀 datetime Öµ
À ......
ÔÚ¼ÆËã»úÖÐÊý¾ÝÓÐÁ½ÖÖÌØÕ÷£ºÀàÐͺͳ¤¶È¡£ËùνÊý¾ÝÀàÐ;ÍÊÇÒÔÊý¾ÝµÄ±íÏÖ·½Ê½ºÍ´æ´¢·½Ê½À´»®·ÖµÄÊý¾ÝµÄÖÖÀà¡£
ÔÚSQL Server ÖÐÿ¸ö±äÁ¿¡¢²ÎÊý¡¢±í´ïʽµÈ¶¼ÓÐÊý¾ÝÀàÐÍ¡£ÏµÍ³ÌṩµÄÊý¾ÝÀàÐÍ·ÖΪ¼¸´óÀ࣬Èç±í4-2 Ëùʾ¡£
ÆäÖУ¬BIGINT¡¢ SQL_VARIANT ºÍTABLE ÊÇSQL Server 2 ......
In the latest installment of the SQL Server interview questions, we will outline questions suitable for a DBA interview to assess the candidates skills related to SQL Server system databases. In this tip, the questions are there to read, but the answers are intentionally hidden to really test your s ......