Dim num As Integer
成都創(chuàng)新互聯(lián)是一家集網(wǎng)站建設(shè),嘉黎企業(yè)網(wǎng)站建設(shè),嘉黎品牌網(wǎng)站建設(shè),網(wǎng)站定制,嘉黎網(wǎng)站建設(shè)報價,網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,嘉黎網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。
Dim connstr, insertcmd, selectcmd As String
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\360data\重要數(shù)據(jù)\我的文檔\hd.mdb"
Dim conn As OleDbConnection
Dim cmd, cmd1 As OleDbCommand
conn = New OleDbConnection(connstr)
Dim r As OleDbDataReader
conn.Open()
insertcmd = "insert into returnbooks (aid,aname,ISBN,bname,renum,reday) values("
Val(ComboBox1.Text) ",'"
TextBox2.Text "','"
ComboBox2.Text "','"
TextBox2.Text "',"
Val(TextBox3.Text) ",'"
CType(TextBox4.Text, Date) "' )"
cmd = New OleDbCommand(insertcmd, conn)
cmd.ExecuteNonQuery()
updatecmd = "update books set remainnum=" Val(num) "-" Val(TextBox3.Text) " where ISBN='" ComboBox2.Text "'"
cmd = New OleDbCommand(updatecmd, conn)
cmd.ExecuteNonQuery()
updatecmd = "select remainnum as num from books where ISBN= '" ComboBox2.Text "'"
cmd = New OleDbCommand(updatecmd, conn)
cmd.ExecuteNonQuery()
updatecom = "update books set remainnum=num+ " Val(TextBox3.Text) ""
cmd = New OleDbCommand(updatecmd, conn)
cmd.ExecuteNonQuery()
selectcmd = "select remainnum from books where ISBN='" ComboBox2.Text "'"
cmd1 = New OleDbCommand(selectcmd, conn)
r = cmd1.ExecuteReader()
If (r.Read()) Then '如果sql查詢到了數(shù)據(jù)
num = r.GetInt32(0)
End If
conn.Close()
/*注意代碼的格式,不然改起來太費時間*/
電子書太大,發(fā)布過去,樓主可以到網(wǎng)站上下載
;restype=-1id=10000001ty=0
中文的話,這里有個網(wǎng)站你可以去看看,上面搜羅了很多相關(guān)的書,
如果是英語的話,《Beginning VB.NET 2003》,作者:Thearon Willis, Jonathan Crossland, Richard Blair,其他信息:Wrox(出版社); 3 Sub edition | ISBN:0764556584 | 840 pages | April 9, 2004 | CHM | 32 Mb
使用System.XML
Imports Microsoft.VisualBasic
Imports System
Imports System.IO
Imports System.Xml
namespace HowTo.Samples.XML
public class WriteXmlFileSample
private const document as string = "newbooks.xml"
shared sub Main()
Dim myWriteXmlFileSample as WriteXmlFileSample
myWriteXmlFileSample = new WriteXmlFileSample()
myWriteXmlFileSample.Run(document)
end sub
public sub Run(args As String)
Dim myXmlTextReader as XmlTextReader = nothing
Dim myXmlTextWriter as XmlTextWriter = nothing
try
myXmlTextWriter = new XmlTextWriter (args, nothing)
myXmlTextWriter.Formatting = System.Xml.Formatting.Indented
myXmlTextWriter.WriteStartDocument(false)
myXmlTextWriter.WriteDocType("bookstore", nothing, "books.dtd", nothing)
myXmlTextWriter.WriteComment("此文件表示書店庫存數(shù)據(jù)庫的另一個片斷")
myXmlTextWriter.WriteStartElement("bookstore")
myXmlTextWriter.WriteStartElement("book", nothing)
myXmlTextWriter.WriteAttributeString("genre","autobiography")
myXmlTextWriter.WriteAttributeString("publicationdate","1979")
myXmlTextWriter.WriteAttributeString("ISBN","0-7356-0562-9")
myXmlTextWriter.WriteElementString("title", nothing, "The Autobiography of Mark Twain")
myXmlTextWriter.WriteStartElement("Author", nothing)
myXmlTextWriter.WriteElementString("first-name", "Mark")
myXmlTextWriter.WriteElementString("last-name", "Twain")
myXmlTextWriter.WriteEndElement()
myXmlTextWriter.WriteElementString("price", "7.99")
myXmlTextWriter.WriteEndElement()
myXmlTextWriter.WriteEndElement()
'向文件寫 XML 并關(guān)閉編寫器
myXmlTextWriter.Flush()
myXmlTextWriter.Close()
' 讀取返回的文件并進行分析以確保正確生成 XML
myXmlTextReader = new XmlTextReader (args)
FormatXml (myXmlTextReader, args)
catch e as Exception
Console.WriteLine ("異常:{0}", e.ToString())
finally
Console.WriteLine()
Console.WriteLine("對文件 {0} 的處理已完成。", args)
If Not myXmlTextReader Is Nothing
myXmlTextReader.Close()
end if
'關(guān)閉編寫器
If Not myXmlTextWriter Is Nothing
myXmlTextWriter.Close()
end if
End try
End Sub
private shared Sub FormatXml (reader as XmlTextReader, filename as String)
Dim piCount, docCount, commentCount, elementCount as Integer
Dim attributeCount, textCount, whitespaceCount as Integer
While reader.Read()
Select (reader.NodeType)
case XmlNodeType.ProcessingInstruction:
Format (reader, "ProcessingInstruction")
piCount += 1
case XmlNodeType.DocumentType:
Format (reader, "DocumentType")
docCount += 1
case XmlNodeType.Comment:
Format (reader, "Comment")
commentCount += 1
case XmlNodeType.Element:
Format (reader, "Element")
elementCount += 1
While reader.MoveToNextAttribute()
Format (reader, "Attribute")
end While
if (reader.HasAttributes)
attributeCount += reader.AttributeCount
end if
case XmlNodeType.Text:
Format (reader, "Text")
textCount += 1
case XmlNodeType.Whitespace:
whitespaceCount += 1
End Select
End While
' 顯示該文件的統(tǒng)計信息
Console.WriteLine ()
Console.WriteLine("{0} 文件的統(tǒng)計信息", filename)
Console.WriteLine ()
Console.WriteLine("處理指令:" piCount)
Console.WriteLine("文檔類型:" docCount)
Console.WriteLine("注釋:" commentCount)
Console.WriteLine("元素:" elementCount)
Console.WriteLine("屬性:" attributeCount)
Console.WriteLine("文本:" textCount)
Console.WriteLine("空白:" whitespaceCount)
End Sub
private shared Sub Format(byref reader as XmlTextReader , NodeType as String)
' 格式化輸出
Console.Write(reader.Depth " ")
Console.Write(reader.AttributeCount " ")
Dim i as Integer
for i = 0 to reader.Depth - 1
Console.Write(Strings.chr(9))
Next
Console.Write(reader.Prefix NodeType "" reader.Name "" reader.Value)
Console.WriteLine()
End Sub
End Class
End Namespace
參考:
分享名稱:關(guān)于vb.netisbn的信息
本文鏈接:http://aaarwkj.com/article44/dooodhe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號、定制開發(fā)、App設(shè)計、品牌網(wǎng)站設(shè)計、外貿(mào)建站、App開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)