Sample VB.Net Code with OLEDB Database Connection ( MS Access )

   1:  Public m_cnCustomers As New OleDb.OleDbConnection
   2:      Public m_daCustomers As OleDb.OleDbDataAdapter
   3:      Public m_cbCustomers As OleDb.OleDbCommandBuilder
   4:      Public m_dtCustomers As New DataTable
   5:      Public m_intRowPosition As Integer = 0
   6:      Public m_blnNewRecord As Boolean = False
   7:      Public m_blnUpdateRecord As Boolean = False
   8:   
   9:      '*******************************************************
  10:      '* Procedure   : ConnectToCustomers
  11:      '* Created     : 02/05/2009
  12:      '* -----------------------------------------------------
  13:      '* Notes       : Make the connection. this should be 
  14:      '*             : called from the form
  15:      '*******************************************************
  16:      Public Sub ConnectToCustomers ()
  17:          m_cnCustomers.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & System.Windows.Forms.Application.StartupPath & "\Northwind.mdb"
  18:          m_cnCustomers.Open()
  19:          m_daCustomers = New OleDb.OleDbDataAdapter("SELECT Customers.* FROM Customers", m_cnCustomers)
  20:          m_cbCustomers = New OleDb.OleDbCommandBuilder(m_daCustomers)
  21:          m_daCustomers .Fill(m_dtCustomers )
  22:   
  23:          ' Move to, and display the first row (record)
  24:          m_intRowPosition = 0
  25:          ShowCurrentRecord()
  26:   
  27:      End Sub
  28:   


  29:      '*******************************************************
  30:      '* Procedure   : DatabaseClose
  31:      '* Created     : 02/05/2009
  32:      '* -----------------------------------------------------
  33:      '* Notes       : Close the connection
  34:      '*******************************************************
  35:      Public Sub DatabaseClose()
  36:          m_cnCustomers.Close()
  37:          m_cnCustomers.Dispose()
  38:      End Sub
  39:   
  40:      '*******************************************************
  41:      '* Procedure   : SaveRow
  42:      '* Created     : 02/05/2009
  43:      '* -----------------------------------------------------
  44:      '* Notes       : Save Row to the Database
  45:      '*******************************************************
  46:      Public Sub SaveRow()
  47:          Dim drNewRow As DataRow = m_dtCustomers.NewRow()
  48:   
  49:          With frmMain
  50:              drNewRow("Address") = .txtAddress.Text
  51:              drNewRow("Attachments") = .txtAttachments.Text
  52:              drNewRow("Business Phone") = .txtBusiness Phone.Text
  53:              drNewRow("City") = .txtCity.Text
  54:              drNewRow("Company") = .txtCompany.Text
  55:              drNewRow("Country/Region") = .txtCountry/Region.Text
  56:              drNewRow("E-mail Address") = .txtE-mail Address.Text
  57:              drNewRow("Fax Number") = .txtFax Number.Text
  58:              drNewRow("First Name") = .txtFirst Name.Text
  59:              drNewRow("Home Phone") = .txtHome Phone.Text
  60:              drNewRow("ID") = .txtID.Text
  61:              drNewRow("Job Title") = .txtJob Title.Text
  62:              drNewRow("Last Name") = .txtLast Name.Text
  63:              drNewRow("Mobile Phone") = .txtMobile Phone.Text
  64:              drNewRow("Notes") = .txtNotes.Text
  65:              drNewRow("State/Province") = .txtState/Province.Text
  66:              drNewRow("Web Page") = .txtWeb Page.Text
  67:              drNewRow("ZIP/Postal Code") = .txtZIP/Postal Code.Text
  68:          End With
  69:   
  70:          m_dtCustomers.Rows.Add(drNewRow)
  71:          m_daCustomers.Update(m_dtCustomers)
  72:          m_intRowPosition = m_dtCustomers.Rows.Count - 1
  73:   
  74:          m_blnNewRecord = False
  75:          m_blnUpdateRecord = False
  76:   
  77:          ShowCurrentRecord()
  78:   
  79:      End Sub
  80:   
  81:      '*******************************************************
  82:      '* Procedure   : UpdateRow
  83:      '* Created     : 02/05/2009
  84:      '* -----------------------------------------------------
  85:      '* Notes : Update the current row and update the Database 
  86:      '*******************************************************
  87:      Public Sub UpdateRow()
  88:   
  89:          If m_dtCustomers.Rows.Count <> 0 Then
  90:   
  91:              With frmMain
  92:                  m_dtCustomers.Rows(m_intRowPosition)("Address") = .txtAddress.Text
  93:                  m_dtCustomers.Rows(m_intRowPosition)("Attachments") = .txtAttachments.Text
  94:                  m_dtCustomers.Rows(m_intRowPosition)("Business Phone") = .txtBusiness Phone.Text
  95:                  m_dtCustomers.Rows(m_intRowPosition)("City") = .txtCity.Text
  96:                  m_dtCustomers.Rows(m_intRowPosition)("Company") = .txtCompany.Text
  97:                  m_dtCustomers.Rows(m_intRowPosition)("Country/Region") = .txtCountry/Region.Text
  98:                  m_dtCustomers.Rows(m_intRowPosition)("E-mail Address") = .txtE-mail Address.Text
  99:                  m_dtCustomers.Rows(m_intRowPosition)("Fax Number") = .txtFax Number.Text
 100:                  m_dtCustomers.Rows(m_intRowPosition)("First Name") = .txtFirst Name.Text
 101:                  m_dtCustomers.Rows(m_intRowPosition)("Home Phone") = .txtHome Phone.Text
 102:                  m_dtCustomers.Rows(m_intRowPosition)("ID") = .txtID.Text
 103:                  m_dtCustomers.Rows(m_intRowPosition)("Job Title") = .txtJob Title.Text
 104:                  m_dtCustomers.Rows(m_intRowPosition)("Last Name") = .txtLast Name.Text
 105:                  m_dtCustomers.Rows(m_intRowPosition)("Mobile Phone") = .txtMobile Phone.Text
 106:                  m_dtCustomers.Rows(m_intRowPosition)("Notes") = .txtNotes.Text
 107:                  m_dtCustomers.Rows(m_intRowPosition)("State/Province") = .txtState/Province.Text
 108:                  m_dtCustomers.Rows(m_intRowPosition)("Web Page") = .txtWeb Page.Text
 109:                  m_dtCustomers.Rows(m_intRowPosition)("ZIP/Postal Code") = .txtZIP/Postal Code.Text
 110:              End With
 111:   
 112:              m_daCustomers.Update(m_dtCustomers)
 113:   
 114:          End If
 115:   
 116:          m_blnNewRecord = False
 117:          m_blnUpdateRecord = False
 118:      End Sub
 119:   
 120:      '*******************************************************************
 121:      '* Procedure   : DeleteRecord
 122:      '* Created     : 02/05/2009
 123:      '* Notes       : Delete the current row (record)
 124:      '*******************************************************************
 125:   
 126:      Public Sub DeleteRecord()
 127:          Call CheckState()
 128:          If m_dtCustomers.Rows.Count <> 0 Then
 129:              m_dtCustomers.Rows(m_intRowPosition).Delete()
 130:              m_daCustomers.Update(m_dtCustomers)
 131:              m_intRowPosition -=1 
 132:              If m_intRowPosition < 0 Then
 133:                  m_intRowPosition = 0
 134:              End If
 135:              ShowCurrentRecord()
 136:          End If
 137:      End Sub
 138:   
 139:      '*******************************************************
 140:      '* Procedure   : ShowCurrentRecord
 141:      '* Created     : 02/05/2009
 142:      '* -----------------------------------------------------
 143:      '* Notes       : This will not necessarily be in the 
 144:      '*             : correct order
 145:      '*******************************************************
 146:      Public Sub ShowCurrentRecord()
 147:          With frmMain
 148:   
 149:              If m_dtCustomers.Rows.Count <= 0 Then ' only required for a blank database
 150:                  .txtAddress.Enabled = False
 151:                  .txtAttachments.Enabled = False
 152:                  .txtBusiness Phone.Enabled = False
 153:                  .txtCity.Enabled = False
 154:                  .txtCompany.Enabled = False
 155:                  .txtCountry/Region.Enabled = False
 156:                  .txtE-mail Address.Enabled = False
 157:                  .txtFax Number.Enabled = False
 158:                  .txtFirst Name.Enabled = False
 159:                  .txtHome Phone.Enabled = False
 160:                  .txtID.Enabled = False
 161:                  .txtJob Title.Enabled = False
 162:                  .txtLast Name.Enabled = False
 163:                  .txtMobile Phone.Enabled = False
 164:                  .txtNotes.Enabled = False
 165:                  .txtState/Province.Enabled = False
 166:                  .txtWeb Page.Enabled = False
 167:                  .txtZIP/Postal Code.Enabled = False
 168:                  Exit Sub
 169:              End If
 170:   
 171:              .txtAddress.Text = m_dtCustomers.Rows(m_intRowPosition)("Address").ToString()
 172:              .txtAttachments.Text = m_dtCustomers.Rows(m_intRowPosition)("Attachments").ToString()
 173:              .txtBusiness Phone.Text = m_dtCustomers.Rows(m_intRowPosition)("Business Phone").ToString()
 174:              .txtCity.Text = m_dtCustomers.Rows(m_intRowPosition)("City").ToString()
 175:              .txtCompany.Text = m_dtCustomers.Rows(m_intRowPosition)("Company").ToString()
 176:              .txtCountry/Region.Text = m_dtCustomers.Rows(m_intRowPosition)("Country/Region").ToString()
 177:              .txtE-mail Address.Text = m_dtCustomers.Rows(m_intRowPosition)("E-mail Address").ToString()
 178:              .txtFax Number.Text = m_dtCustomers.Rows(m_intRowPosition)("Fax Number").ToString()
 179:              .txtFirst Name.Text = m_dtCustomers.Rows(m_intRowPosition)("First Name").ToString()
 180:              .txtHome Phone.Text = m_dtCustomers.Rows(m_intRowPosition)("Home Phone").ToString()
 181:              .txtID.Text = m_dtCustomers.Rows(m_intRowPosition)("ID").ToString()
 182:              .txtJob Title.Text = m_dtCustomers.Rows(m_intRowPosition)("Job Title").ToString()
 183:              .txtLast Name.Text = m_dtCustomers.Rows(m_intRowPosition)("Last Name").ToString()
 184:              .txtMobile Phone.Text = m_dtCustomers.Rows(m_intRowPosition)("Mobile Phone").ToString()
 185:              .txtNotes.Text = m_dtCustomers.Rows(m_intRowPosition)("Notes").ToString()
 186:              .txtState/Province.Text = m_dtCustomers.Rows(m_intRowPosition)("State/Province").ToString()
 187:              .txtWeb Page.Text = m_dtCustomers.Rows(m_intRowPosition)("Web Page").ToString()
 188:              .txtZIP/Postal Code.Text = m_dtCustomers.Rows(m_intRowPosition)("ZIP/Postal Code").ToString()
 189:              .Label1.Text = "Row Number = " & m_intRowPosition
 190:          End With
 191:   
 192:      End Sub
 193:   
 194:      '*******************************************************
 195:      '* Procedure   : ClearText
 196:      '* Created     : 02/05/2009
 197:      '* -----------------------------------------------------
 198:      '* Notes       : 
 199:      '*******************************************************
 200:      Public Sub ClearText()
 201:          m_blnNewRecord = True
 202:          With frmMain
 203:              If .txtAttachments.Enabled = False Then
 204:                  .txtAddress.Enabled = True
 205:                  .txtAttachments.Enabled = True
 206:                  .txtBusiness Phone.Enabled = True
 207:                  .txtCity.Enabled = True
 208:                  .txtCompany.Enabled = True
 209:                  .txtCountry/Region.Enabled = True
 210:                  .txtE-mail Address.Enabled = True
 211:                  .txtFax Number.Enabled = True
 212:                  .txtFirst Name.Enabled = True
 213:                  .txtHome Phone.Enabled = True
 214:                  .txtID.Enabled = True
 215:                  .txtJob Title.Enabled = True
 216:                  .txtLast Name.Enabled = True
 217:                  .txtMobile Phone.Enabled = True
 218:                  .txtNotes.Enabled = True
 219:                  .txtState/Province.Enabled = True
 220:                  .txtWeb Page.Enabled = True
 221:                  .txtZIP/Postal Code.Enabled = True
 222:              End If
 223:              .txtAddress.Text = ""
 224:              .txtAttachments.Text = ""
 225:              .txtBusiness Phone.Text = ""
 226:              .txtCity.Text = ""
 227:              .txtCompany.Text = ""
 228:              .txtCountry/Region.Text = ""
 229:              .txtE-mail Address.Text = ""
 230:              .txtFax Number.Text = ""
 231:              .txtFirst Name.Text = ""
 232:              .txtHome Phone.Text = ""
 233:              .txtID.Text = ""
 234:              .txtJob Title.Text = ""
 235:              .txtLast Name.Text = ""
 236:              .txtMobile Phone.Text = ""
 237:              .txtNotes.Text = ""
 238:              .txtState/Province.Text = ""
 239:              .txtWeb Page.Text = ""
 240:              .txtZIP/Postal Code.Text = ""
 241:   
 242:              .txtID.Text = GetNextID().ToString
 243:   
 244:          End With
 245:      End Sub
 246:   
 247:      '*******************************************************
 248:      '* Procedure   : GetNextID
 249:      '* Created     : 02/05/2009
 250:      '* -----------------------------------------------------
 251:      '* Notes       : Get The Database Index
 252:      '*******************************************************
 253:      Public Function GetNextID() As Integer
 254:          If m_dtCustomers.Rows.Count <= 0 Then
 255:              GetNextID = 0
 256:              Exit Function
 257:          Else
 258:          GetNextID = m_dtCustomers.Rows(m_dtCustomers.Rows.Count - 1)("ID").ToString() + 1
 259:          End If
 260:   
 261:      End Function
 262:      ' *******************************************************************
 263:      ' * The Folowing routines have not be modified by the database
 264:      ' * except for the last routine (Private Sub Changed) which must be
 265:      ' * copied to the form.
 266:      ' *******************************************************************
 267:   
 268:      ' ******************************************************
 269:      ' * Standard routine templates
 270:      ' ******************************************************
 271:   
 272:      '*******************************************************
 273:      '* Procedure   : First
 274:      '* Created     : 02/05/2009
 275:      '* -----------------------------------------------------
 276:      '* Notes       : 
 277:      '*******************************************************
 278:      Public Sub First()
 279:   
 280:          m_intRowPosition = 0
 281:          ShowCurrentRecord()
 282:   
 283:      End Sub
 284:   
 285:      '*******************************************************
 286:      '* Notes       : Navigation
 287:      '*******************************************************
 288:      Public Sub Previous()
 289:          Call CheckState()
 290:          If m_intRowPosition > 0 Then
 291:              m_intRowPosition -= 1
 292:              ShowCurrentRecord()
 293:          End If
 294:      End Sub
 295:      Public Sub NextRecord()
 296:          Call CheckState()
 297:          If m_intRowPosition < (m_dtCustomers.Rows.Count - 1) Then
 298:              m_intRowPosition += 1
 299:              ShowCurrentRecord()
 300:          End If
 301:      End Sub
 302:      Public Sub LastRecord()
 303:          Call CheckState()
 304:          If m_dtCustomers.Rows.Count > 0 Then
 305:              m_intRowPosition = m_dtCustomers.Rows.Count - 1
 306:              ShowCurrentRecord()
 307:          End If
 308:      End Sub
 309:   
 310:      '*******************************************************
 311:      '* Procedure   : CheckState
 312:      '* Created     : 02/05/2009
 313:      '* -----------------------------------------------------
 314:      '* Notes       : 
 315:      '*******************************************************
 316:      Private Sub CheckState()
 317:          If frmMain.CheckBox1.Checked = True Then
 318:              If RecordChanged() = True Then
 319:                  Call CheckNewUpdate()
 320:              End If
 321:          End If
 322:      End Sub
 323:      '*******************************************************
 324:      '* Procedure   : CheckNewUpdate
 325:      '* Created     : 02/05/2009
 326:      '* -----------------------------------------------------
 327:      '* Notes       : 
 328:      '*******************************************************
 329:      Public Sub CheckNewUpdate()
 330:          If m_blnNewRecord = True Then
 331:              Call SaveRow()
 332:          Else
 333:              If m_blnUpdateRecord = True Then
 334:                  UpdateRow()
 335:              End If
 336:          End If
 337:      End Sub
 338:   
 339:      '*******************************************************
 340:      '* Procedure   : RecordChanged
 341:      '* Created     : 02/05/2009
 342:      '* -----------------------------------------------------
 343:      '* Notes       : Quick check has record changed
 344:      '*******************************************************
 345:      Public Function RecordChanged() As Boolean
 346:          Dim Result As Boolean = False
 347:          If m_blnNewRecord = True Or m_blnUpdateRecord = True Then
 348:              Result = True
 349:          End If
 350:          Return Result
 351:      End Function
 352:     
 353:      ' *******************************************************************
 354:      ' * The folowing List shows the the text boxes and Controls that 
 355:      ' * should be built into the form.
 356:      ' *******************************************************************
 357:   
 358:      ' Add 8 Buttons 1 Lable and 1 CheckBox.
 359:   
 360:      ' Button1   name as  btnUpdate
 361:      ' Button2   name as  btnSave
 362:      ' Button3   name as  btnAddNew
 363:      ' Button4   name as  btnPrevious
 364:      ' Button5   name as  btnFirst
 365:      ' Button6   name as  btnNext
 366:      ' Button7   name as  btnLast
 367:      ' Button8   name as  btnDelete
 368:      ' CheckBox1 name as  CheckBox1
 369:      ' Lable     name as  Lable1
 370:   
 371:      ' *******************************************************************
 372:   
 373:      ' Add 17 TextBoxes with the names as shown:
 374:   
 375:     ' TextBox0   name as  txtAddress
 376:     ' TextBox1   name as  txtAttachments
 377:     ' TextBox2   name as  txtBusiness Phone
 378:     ' TextBox3   name as  txtCity
 379:     ' TextBox4   name as  txtCompany
 380:     ' TextBox5   name as  txtCountry/Region
 381:     ' TextBox6   name as  txtE-mail Address
 382:     ' TextBox7   name as  txtFax Number
 383:     ' TextBox8   name as  txtFirst Name
 384:     ' TextBox9   name as  txtHome Phone
 385:     ' TextBox10   name as  txtID
 386:     ' TextBox11   name as  txtJob Title
 387:     ' TextBox12   name as  txtLast Name
 388:     ' TextBox13   name as  txtMobile Phone
 389:     ' TextBox14   name as  txtNotes
 390:     ' TextBox15   name as  txtState/Province
 391:     ' TextBox16   name as  txtWeb Page
 392:     ' TextBox17   name as  txtZIP/Postal Code
 393:      ' *******************************************************************
 394:      ' * These should placed in frmMain and are the routines to handle
 395:      ' * the navigation and editing of the database
 396:      ' *******************************************************************
 397:   
 398:      ' *******************************************************************
 399:   
 400:      '*******************************************************
 401:      '* Procedure   : frmMain_Load
 402:      '* Created     : 26/08/200716:13
 403:      '* -----------------------------------------------------
 404:      '* Notes       : On load Call the Make connection 
 405:      '*             : to connect to the database
 406:      '*******************************************************
 407:      Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 408:          Call ConnectToCustomers()
 409:      End Sub
 410:   
 411:      '*******************************************************
 412:      '* Procedure   : frmMain_FormClosed
 413:      '* Created     : 26/08/200716:13
 414:      '* -----------------------------------------------------
 415:      '* Notes       : Close the database down on exit
 416:      '*******************************************************
 417:      Private Sub frmMain_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
 418:          Call DatabaseClose()
 419:      End Sub
 420:   
 421:      '*******************************************************
 422:      '* Procedure   : btnUpdate_Click
 423:      '* Created     : 26/08/200716:13
 424:      '* -----------------------------------------------------
 425:      '* Notes       : Transfer changes back to the database
 426:      '*******************************************************
 427:      Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
 428:          Call UpdateRow()
 429:      End Sub
 430:   
 431:      '*******************************************************
 432:      '* Procedure   : btnSave_Click
 433:      '* Created     : 26/08/200716:13
 434:      '* -----------------------------------------------------
 435:      '* Notes       : Save the Row (record) to the database
 436:      '*******************************************************
 437:      Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
 438:          Call SaveRow()
 439:      End Sub
 440:   
 441:      '*******************************************************
 442:      '* Procedure   : btnAddNew_Click
 443:      '* Created     : 26/08/200716:13
 444:      '* -----------------------------------------------------
 445:      '* Notes       : This simply clears the textboxes 
 446:      '*******************************************************
 447:      Private Sub btnAddNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddNew.Click
 448:          Call ClearText()
 449:      End Sub
 450:   
 451:   
 452:      '*******************************************************
 453:      '* Notes     : Navigate the DataTable
 454:      '*******************************************************
 455:      Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
 456:          Call Previous()
 457:      End Sub
 458:      '* -----------------------------------------------------
 459:      Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click
 460:          Call First()
 461:      End Sub
 462:      '* -----------------------------------------------------
 463:      Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
 464:          Call NextRecord()
 465:      End Sub
 466:      '* -----------------------------------------------------
 467:      Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
 468:          Call LastRecord()
 469:      End Sub
 470:   
 471:      '*******************************************************
 472:      '* Procedure   : btnDelete_Click
 473:      '* Created     : 26/08/200716:13
 474:      '* -----------------------------------------------------
 475:      '* Notes       : 
 476:      '*******************************************************
 477:      Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
 478:          Call DeleteRecord()
 479:      End Sub
 480:   
 481:      Private Sub CheckBox()
 482:          If CheckBox1.Checked = True Then
 483:              btnUpdate.Visible = False
 484:              btnSave.Visible = False
 485:          Else
 486:              btnUpdate.Visible = True
 487:              btnSave.Visible = True
 488:          End If
 489:      End Sub
 490:   
 491:      Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
 492:          Call CheckBox()
 493:      End Sub
 494:      ' *******************************************************************
 495:      ' * The folowing routine has been modified by the database
 496:      ' *******************************************************************
 497:     
 498:      '*******************************************************
 499:      '* Procedure   : Changed
 500:      '* Created     : 02/05/2009
 501:      '* -----------------------------------------------------
 502:      '* Notes       : 
 503:      '*******************************************************
 504:      Private Sub Changed(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles _
 505:          txtAddress.KeyDown, _
 506:          txtAttachments.KeyDown, _
 507:          txtBusiness Phone.KeyDown, _
 508:          txtCity.KeyDown, _
 509:          txtCompany.KeyDown, _
 510:          txtCountry/Region.KeyDown, _
 511:          txtE-mail Address.KeyDown, _
 512:          txtFax Number.KeyDown, _
 513:          txtFirst Name.KeyDown, _
 514:          txtHome Phone.KeyDown, _
 515:          txtID.KeyDown, _
 516:          txtJob Title.KeyDown, _
 517:          txtLast Name.KeyDown, _
 518:          txtMobile Phone.KeyDown, _
 519:          txtNotes.KeyDown, _
 520:          txtState/Province.KeyDown, _
 521:          txtWeb Page.KeyDown, _
 522:          txtZIP/Postal Code.KeyDown
 523:          m_blnUpdateRecord = True
 524:   
 525:      End Sub

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

About these ads

About lpujangga


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: