急问,datagrid中改变某行颜色;恢复数据库

nalnait 2007-05-30 06:23:16


Private Sub BackRest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Dim ServerName As String
Dim UserName As String
Dim Password As String
Try
If gSQLServer Is Nothing Then
gSQLServer = New SQLDMO.SQLServer
End If
ServerName = "(local)"
UserName = ""
Password = ""
gSQLServer.LoginSecure = True
Try
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
gSQLServer.Connect(ServerName, UserName, Password)
gbConnected = True

System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
Catch ex As SqlException
MsgBox(ex.Message)

End Try

Exit Sub

Catch
MsgBox("错误: " & Err.Description)

If System.Windows.Forms.Cursor.Current.Equals(System.Windows.Forms.Cursors.WaitCursor) Then
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
End If
End Try

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
If (br.conn.State = ConnectionState.Open) Then
br.conn.Close()
End If
Dim oRestore As SQLDMO.Restore
Dim Msg As String
Dim Response As String
gDatabaseName = "Library"
oRestore = New SQLDMO.Restore
oRestoreEvent = oRestore
oRestore.Database = gDatabaseName
gBkupRstrFileName = "c:\Library.bak"
oRestore.Files = gBkupRstrFileName
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
'恢复数据库
oRestore.SQLRestore(gSQLServer)
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
oRestoreEvent = Nothing
oRestore = Nothing
Exit Sub
Catch
MsgBox("错误 " & Err.Description)
End Try
End Sub



-------------------------
1..如何改变不符合条件的某行,如超额的那行为红色。
2..为什么我在恢复数据库时有错。备份是可以的。
谢谢了
...全文
236 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
新鲜鱼排 2007-05-31
  • 打赏
  • 举报
回复
1. http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q480q
重写OnPaint事件,对数据判断来修改颜色。
2.怎么好用怎么弄,应该是恢复的方法和备份的没有对应上。

16,556

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧