标题:[分享] vb.net做的一套简单的图书管理系统原代码!适合菜鸟学习用
只看楼主
蓝冰小猫
Rank: 1
等 级:新手上路
威 望:1
帖 子:260
专家分:0
注 册:2006-5-9
得分:0 

呵呵,谢谢你哦,找的好辛苦哦。
做的真好,非常感谢!


偶要减肥!!!
2006-05-09 09:22
dachouyu
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2006-4-18
得分:0 
里面没东西的嘛.

2006-05-09 11:02
Viviwei
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:344
专家分:0
注 册:2006-4-11
得分:0 

当然,全都有的话我还叫给你们借鉴,不就是抄袭了?


爱上思考,爱上编程,爱上.net!
2006-05-09 13:54
Viviwei
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:344
专家分:0
注 册:2006-4-11
得分:0 
经过本人一个星期的努力,经过一系列的更改后,一套适合菜鸟学习的图书管理系统终于完成了,里面不包含类的调用,每个页面都包含数据库的连接,我认为很利于新手的刚刚认识时的学习..

爱上思考,爱上编程,爱上.net!
2006-05-13 12:34
pennyong
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-5-12
得分:0 

谢谢 给我的数据库

2006-05-13 13:38
wjh_36
Rank: 1
等 级:新手上路
帖 子:81
专家分:0
注 册:2006-5-10
得分:0 

我作了一个和你的功能查不多的程序,但出了很多错误,修改记录时,无出现错误,但数据库里的记录不变,代码如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As New SqlConnection
conn.ConnectionString = ConfigurationSettings.AppSettings("aa")
conn.Open()
Dim cmd As New SqlCommand
cmd.Connection = conn
cmd.CommandText = "update info set u_name='" & TextBox1.Text & "',u_sex='" & TextBox2.Text & "',u_birt='" & TextBox3.Text & "',u_indate='" & TextBox4.Text & "',u_code='" & TextBox5.Text & "',u_tel='" & TextBox6.Text & "',u_zhy='" & TextBox7.Text & "',u_dw='" & TextBox8.Text & "',u_time1='" & TextBox9.Text & "',u_sch1='" & TextBox10.Text & "',u_zhy1='" & TextBox11.Text & "',u_time2='" & TextBox12.Text & "',u_sch2='" & TextBox13.Text & "',u_zhy2='" & TextBox14.Text & "',u_time3='" & TextBox15.Text & "',u_sch3='" & TextBox16.Text & "',u_zhy3='" & TextBox17.Text & "',u_chg='" & TextBox18.Text & "',u_ky='" & TextBox19.Text & "',u_xsh='" & TextBox20.Text & "',u_xzhw1='" & TextBox21.Text & "',u_xdate1='" & TextBox22.Text & "',u_xmch1='" & TextBox23.Text & "',u_xzhw2='" & TextBox24.Text & "',u_xdate2='" & TextBox25.Text & "',u_xmch2='" & TextBox26.Text & "',u_xzhw3='" & TextBox27.Text & "',u_xdate3='" & TextBox28.Text & "',u_xmch3='" & TextBox29.Text & "',u_shzhw1='" & TextBox30.Text & "',u_shdate1='" & TextBox31.Text & "',u_shmch1='" & TextBox32.Text & "',u_shzhw2='" & TextBox33.Text & "',u_shdate2='" & TextBox34.Text & "',u_shmch2='" & TextBox35.Text & "',u_shzhw3='" & TextBox36.Text & "',u_shdate3='" & TextBox37.Text & "',u_shmch3='" & TextBox38.Text & "',u_men='" & TextBox39.Text & "' where u_id='" & TextBox40.Text & "'"

cmd.ExecuteNonQuery()
conn.Close()
End Sub


2006-05-16 09:33
wjh_36
Rank: 1
等 级:新手上路
帖 子:81
专家分:0
注 册:2006-5-10
得分:0 

我做了一个和你功能查不多的程序,但修改记录时,运行时页面没有什么错误,但数据库里的记录就不变这是怎么回事啊,代码如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As New SqlConnection
conn.ConnectionString = ConfigurationSettings.AppSettings("aa")
conn.Open()
Dim cmd As New SqlCommand
cmd.Connection = conn

cmd.CommandText = "update info set u_name='" & TextBox1.Text & "',u_sex='" & TextBox2.Text & "',u_birt='" & TextBox3.Text & "',u_indate='" & TextBox4.Text & "',u_code='" & TextBox5.Text & "',u_tel='" & TextBox6.Text & "',u_zhy='" & TextBox7.Text & "',u_dw='" & TextBox8.Text & "',u_time1='" & TextBox9.Text & "',u_sch1='" & TextBox10.Text & "',u_zhy1='" & TextBox11.Text & "',u_time2='" & TextBox12.Text & "',u_sch2='" & TextBox13.Text & "',u_zhy2='" & TextBox14.Text & "',u_time3='" & TextBox15.Text & "',u_sch3='" & TextBox16.Text & "',u_zhy3='" & TextBox17.Text & "',u_chg='" & TextBox18.Text & "',u_ky='" & TextBox19.Text & "',u_xsh='" & TextBox20.Text & "',u_xzhw1='" & TextBox21.Text & "',u_xdate1='" & TextBox22.Text & "',u_xmch1='" & TextBox23.Text & "',u_xzhw2='" & TextBox24.Text & "',u_xdate2='" & TextBox25.Text & "',u_xmch2='" & TextBox26.Text & "',u_xzhw3='" & TextBox27.Text & "',u_xdate3='" & TextBox28.Text & "',u_xmch3='" & TextBox29.Text & "',u_shzhw1='" & TextBox30.Text & "',u_shdate1='" & TextBox31.Text & "',u_shmch1='" & TextBox32.Text & "',u_shzhw2='" & TextBox33.Text & "',u_shdate2='" & TextBox34.Text & "',u_shmch2='" & TextBox35.Text & "',u_shzhw3='" & TextBox36.Text & "',u_shdate3='" & TextBox37.Text & "',u_shmch3='" & TextBox38.Text & "',u_men='" & TextBox39.Text & "' where u_id='" & TextBox40.Text & "'"

cmd.ExecuteNonQuery()
conn.Close()
End Sub


2006-05-16 09:42
wjh_36
Rank: 1
等 级:新手上路
帖 子:81
专家分:0
注 册:2006-5-10
得分:0 
还有一个问题就是如下:
[求助]未将对象引用设置到对象的实例

Dim conn As New SqlConnection
conn.ConnectionString = ConfigurationSettings.AppSettings("aa")
Dim cmd As New SqlCommand

cmd.CommandText = "select u_id as 编号,u_name as 姓名,u_sex as 性别,u_indate as 入学时间,u_zhy as 所学专业,u_dw as 所在单位 from info where u_id='" & TextBox1.Text & "'"
cmd.Connection = conn
conn.Open()
Dim dr As New SqlDataAdapter
Dim ds As New DataSet
dr.Fill(ds, "info")
DataGrid1.DataSource = ds.Tables("info")
DataGrid1.DataBind()
conn.Close()




出现错误如下:

“/dn”应用程序中的服务器错误。

未将对象引用设置到对象的实例。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。

源错误:

行 42: 
行 43: cmd.CommandText = "select u_id as 编号,u_name as 姓名,u_sex as 性别,u_indate as 入学时间,u_zhy as 所学专业,u_dw as 所在单位 from info where u_id='" & TextBox1.Text & "'" 行 44: cmd.Connection = conn 行 45: conn.Open()
行 46: Dim dr As New SqlDataAdapter

源文件: c:\inetpub\wwwroot\dn\cbh.aspx.vb 行: 44

堆栈跟踪:

[NullReferenceException: 未将对象引用设置到对象的实例。]
dn.chaxun.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\dn\cbh.aspx.vb:44
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()


2006-05-16 09:46
wjh_36
Rank: 1
等 级:新手上路
帖 子:81
专家分:0
注 册:2006-5-10
得分:0 
如果在里面添加打印代码,该怎么写啊

2006-05-16 10:15
Viviwei
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:344
专家分:0
注 册:2006-4-11
得分:0 
以下是引用wjh_36在2006-5-16 9:46:00的发言:
还有一个问题就是如下:
[求助]未将对象引用设置到对象的实例

Dim conn As New SqlConnection
conn.ConnectionString = ConfigurationSettings.AppSettings("aa")
Dim cmd As New SqlCommand

cmd.CommandText = "select u_id as 编号,u_name as 姓名,u_sex as 性别,u_indate as 入学时间,u_zhy as 所学专业,u_dw as 所在单位 from info where u_id='" & TextBox1.Text & "'"
cmd.Connection = conn
conn.Open()
Dim dr As New SqlDataAdapter
Dim ds As New DataSet
dr.Fill(ds, "info")
DataGrid1.DataSource = ds.Tables("info")
DataGrid1.DataBind()
conn.Close()




出现错误如下:

“/dn”应用程序中的服务器错误。

未将对象引用设置到对象的实例。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。

源错误:

行 42: 
行 43: cmd.CommandText = "select u_id as 编号,u_name as 姓名,u_sex as 性别,u_indate as 入学时间,u_zhy as 所学专业,u_dw as 所在单位 from info where u_id='" & TextBox1.Text & "'"
行 44: cmd.Connection = conn
行 45: conn.Open()
行 46: Dim dr As New SqlDataAdapter

源文件: c:\inetpub\wwwroot\dn\cbh.aspx.vb 行: 44

堆栈跟踪:

[NullReferenceException: 未将对象引用设置到对象的实例。]
dn.chaxun.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\dn\cbh.aspx.vb:44
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()

试试将程序代码改为下面的:
Dim dr As New SqlDataAdapter
Dim ds As New DataSet
conn.Open()
cmd.CommandText = "select u_id as 编号,u_name as 姓名,u_sex as 性别,u_indate as 入学时间,u_zhy as 所学专业,u_dw as 所在单位 from info where u_id='" & TextBox1.Text & "'"
cmd.Connection = conn
cmd.CommandType = CommandType.Text
dr.SelectCommand = comm
dr.Fill(ds, "info")
DataGrid1.DataSource = ds.Tables("info")
DataGrid1.DataBind()
conn.Close()


爱上思考,爱上编程,爱上.net!
2006-05-16 13:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-60010-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.418872 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved