C#²Ù×÷¸÷ÖÖÖ´ÐÐsqlµÄ·½·¨º¬´æ´¢¹ý³Ì²Ù×÷
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Xml;
using System.Data;
namespace MyDbTest
{
class Program
{
static void Main(string[] args)
{
SqlConnection thisConnection = new SqlConnection(
@"Data Source=localhost;Initial Catalog=CSGL;Persist Security Info=True;User ID=test;Password=test");
thisConnection.Open();
SqlCommand myCommand = new SqlCommand("P_Test", thisConnection);
myCommand.CommandType = CommandType.StoredProcedure;
//Ìí¼ÓÊäÈë²éѯ²ÎÊý¡¢¸³ÓèÖµ
myCommand.Parameters.Add("@id", SqlDbType.Int);
myCommand.Parameters["@id"].Value = "120";
//Ìí¼ÓÊä³ö²ÎÊý
myCommand.Parameters.Add("@Rowcount", SqlDbType.Int);
myCommand.Parameters["@Rowcount"].Direction = ParameterDirection.Output;
myCommand.ExecuteNonQuery();
//µÃµ½´æ´¢¹ý³ÌÊä³ö²ÎÊý
Console.WriteLine(" ´æ´¢¹ý³ÌµÄ²ÎÊý"+ myCommand.Parameters["@Rowcount"].Value.ToString());
thisConnection.Close();
Console.ReadLine();
//SqlCommand thisCommand = thisConnection.CreateCommand();
//thisCommand.CommandText = "select count(*) from stu";
////ExecuteScalar£ºÖ´ÐÐÖ»·µ»ØÒ»¸öÖµµÄSQLÃüÁî¡£
//object countResult = thisCommand.ExecuteScalar();
//Console.WriteLine("Count of Customers={0}", countResult);
//thisConnection.Close();
//Console.ReadLine();
//SqlCommand thisCommand = thisConnection.CreateCommand();
//thisCommand.CommandText = "update stu set snm='haha' where id=120";
////Inset,Update,DelelteµÄÊý¾ÝÐ޸IJÙ×÷Ò²²»·µ»ØÈκÎÊý¾Ý£¬
////ÎÒÃǶÔÕâЩÃüÁî¸ÐÐËȤµÄÊÇÐ޸IJÙ×÷Ó°ÏìµÄÐÐÊý£¬¿ÉÒÔÓÃExecuteNonQuery()·½·¨
//int rowsAffected = thisCommand.ExecuteNonQuery();
//Console.WriteLine("Rows Updated={0}", rowsAffected);
//thisConnection.
Ïà¹ØÎĵµ£º
1Ð޸Ļù±¾±í
Ìí¼ÓÁÐ alter table tableName add<ÐÂÁÐÃû><Êý¾ÝÀàÐÍ>[ÍêÕûÐÔÔ¼Êø]
ɾ³ýÁÐ alter table tableName drop<ÐÂÁÐÃû><Êý¾ÝÀàÐÍ>[ÍêÕûÐÔÔ¼Êø]
2´´½¨
½¨±ícreate table tableName(
id primary key AUTO_INCREMENT(mysql);
id primary key identity(1,1)(s ......
±¾ÎĽ«c#ÓïÑÔ²Ù×÷AccessÊý¾Ý¿âµÄ·½·¨¼ÓÒÔ×ܽᣬÖ÷Òª½â¾öµÄÎÊÌâÈçÏ£º
´´½¨mdb
´´½¨table
¶ÁÈ¡tableÄÚÈÝ
²é
ѯtableÖеÄÄÚÈÝ
ÏòtableÖвåÈëÊý¾Ý
ɾ³ýtableÖеļǼ
ÏòtableÖвåÈëÕÕÆ¬
¶ÁÈ¡tableÖеÄÕÕÆ¬µÈ¡£
ÎÄ
½éÉÜC#
·ÃÎʲÙ×÷AccessÊý¾Ý¿âµÄ»ù´¡ÖªÊ¶£¬²¢Ìá
¹©Ò»¸öÏà¹ØµÄÀý³Ì¡£C#µÄADO.NET»¹²»ÄÜͨ¹ý±à³Ì·½Ê½´ ......
1.ÈçºÎÔÚjavascript·ÃÎÊC#±äÁ¿
·½·¨Ò»£ºÊ¹ÓÃ<%=%>
<input id="Button3" type="button" value="jsµ÷ÓÃc#±äÁ¿" onclick="return Button3_onclick()" />
function Button3_onclick()
{
alert('ÎÒµÄÃû×Ö£º'+ '<%=name %>'); ......
¾²Ì¬±äÁ¿
µ±ÎÒÃDZàдһ¸öÀàʱ£¬Æäʵ¾ÍÊÇÔÚÃèÊöÆä¶ÔÏóµÄÊôÐÔºÍÐÐΪ£¬¶ø²¢Ã»ÓвúÉúʵÖÊÉϵĶÔÏó£¬Ö»ÓÐͨ¹ýnew¹Ø¼ü×ֲŻá²úÉú³ö¶ÔÏó£¬Õâʱϵͳ²Å»á·ÖÅäÄÚ´æ¿Õ¼ä¸ø¶ÔÏ󣬯䷽·¨²Å¿ÉÒÔ¹©Íⲿµ÷Óá£
ÓÐʱºò£¬ÎÒÃÇÏ£ÍûÎÞÂÛÊÇ·ñ²úÉúÁ˶ÔÏó»òÎÞÂÛ ......
ÍøÕ¾£ºhttp://werysoft.com/
Èç¹ûÄú±ØÐë¹ÜÀí»·¾³ÖеĶàÖÖÀàÐ͵ÄÊý¾Ý¿â·þÎñÆ÷£¬ÔòʹÓü¯ÖÐʽ¹¤¾ßµ÷ÕûËùÓÐÊý¾Ý¿â¿ÉÄÜ»á±È½Ï·½±ã¡£Werysoft µÄ QweryBuilder Ö¼ÔÚΪÄúÌṩ´ËÏÄÜ¡£Äú¿ÉÒÔʹÓÃËü´Óͬһ GUI Á¬½Óµ½ Microsoft SQL Server¡¢Sybase ASE¡¢SQL Anywhere ºÍ Oracle ʵÀý£¬È»ºó²é¿´¡¢´´½¨¡¢¸üкÍɾ³ýÊý¾Ý¿â½Å±¾¡¢¼Ü ......