trunc ( date, [ format ] )取時間中的日期
http://kuanglian2000.wordpress.com/2006/12/18/oracle-function時間只取時間中的日期或時間
trunc ( date, [ format ] )取時間中的日期
Imports System.Data.SqlClient
Try
Using conn As New SqlConnection(strConn)
Using cmd As New SqlCommand("Insert into product(productName,)Values(@123,)", conn)
conn.Open()
cmd.Parameters.AddWithValue("@123", Me.TextBox1.Text)
cmd.ExecuteNonQuery()
End Using
End Using
Catch ex As Exception
MsgBox(ex.Message)
End Try
Data Source=.;Initial Catalog=Northwind;User ID=sa;Password=123使用Windows驗證
Data Source=.;Initial Catalog=Northwind;Integrated Security=TrueData Source資料來源
Initial Catalog要連結的資料庫 User ID使用者名稱Password密碼 Integrated Security=True(使用Windows驗證登入)web.config
<connectionStrings> <add name="DBConnectionString" connectionString="Data Source=.;Initial Catalog=abc;User ID=sa;Password=abc" providerName="System.Data.SqlClient" /> </connectionStrings>windows驗證
<add name="DBConnectionString" connectionString="data source=.;initial catalog=ShuLong;integrated security=true;"/>.cs裡
using System.Configuration;//抓Web.config用 string Conn = ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString;
Imports System.Threading Me.Label1.Text =Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageNameMe.Label2.Text = Thread.CurrentThread.CurrentUICulture.NativeNameMe.Label3.Text = Thread.CurrentThread.CurrentCulture.NativeName
Protected Sub 匯出Word(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.GridView1.AllowSorting = False
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=" & Me.HiddenField1.Value & ".doc")
Response.ContentType = "application/vnd.ms-word"
Dim stringWrite As System.IO.StringWriter = New System.IO.StringWriter
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite)
Response.Write("")
GridView1.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString)
Response.End()
End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
'處理'GridView' 的控制項 'GridView' 必須置於有 runat=server 的表單標記之中
End Sub
AutoEventWireup="false" EnableEventValidation="false"
Dim MyURL As String
MyURL = "<a href="http://www.contoso.com/articles.aspx?title">http://www.contoso.com/articles.aspx?title</a>=" & trim(Server.UrlEncode("ASP.NET Examples"))
Response.Write( "<a href="http://www.blogger.com/&%20MyURL%20&"> ASP.NET Examples </a>")