Search Results:

Monday, November 16, 2009

Copy rows from one grid view to another grid view.

I haven't tried this code on my own but my friend used this code to bring this functionality, I just wanted to share so that someone might get benifitted from this code

The code is in VB.NET

If (e.Control And e.KeyCode = Keys.V) Then
Dim s As String = Clipboard.GetText()
Dim lines As String()
lines = System.Text.RegularExpressions.Regex.Split(s, Environment.NewLine)
'Dim row As Integer = dgv.CurrentCell.RowIndex
'Dim col As Integer = dgv.CurrentCell.ColumnIndex
Dim row, col As Integer
For intRow As Integer = 0 To dgv.RowCount - 1
For intCol As Integer = 0 To dgv.ColumnCount - 1
If dgv.Rows(intRow).Cells(intCol).Selected = True Then
row = intRow
col = intCol
Exit For
End If
Next
If Not (row = 0 And col = 0) Then
Exit For
End If
Next
For intNextLine As Integer = 0 To (lines.Length - 1)
If (row < dgv.RowCount And lines(intNextLine).Length > 0) Then
Dim cells As String() = System.Text.RegularExpressions.Regex.Split(lines(intNextLine), "\t")
For i As Integer = 0 To cells.Length - 1
If (col + i < dgv.ColumnCount) Then
dgv.Rows(row).Cells(col + i).Value = cells(i)
End If
Next
row = row + 1
End If
Next
End If

Wednesday, November 4, 2009

Code Sample to Combine two PDF files

How To: Combine PDFs Using InsertPages



Issue
How do I combine multiple PDFs into one PDF using Visual Basic?
Solution
This record contains VisualBasic code to demonstrate AcroExch.PDDoc InsertPages.

As far as InsertPages is concerned, the tricky part is to remember that the page number you will be inserting after is -1; in other words, you want to insert these pages before page 0, which is the first page of the document.

Private Sub Command1_Click()
Dim b As Boolean

Dim AcroPDDoc As CAcroPDDoc
Dim PDDoc As CAcroPDDoc

Set AcroPDDoc = CreateObject("AcroExch.PDDoc")
Set PDDoc = CreateObject("AcroExch.PDDoc")

b = PDDoc.Open("c:\testinsertpages.pdf")
b = AcroPDDoc.Open("c:\Tips.pdf")
b = AcroPDDoc.InsertPages(0, PDDoc, 0, 1, False)
b = AcroPDDoc.Save(1, "c:\Tips.pdf")

End Sub

Monday, November 2, 2009

Combine 2 PDF's Using vb.net

How To: Combine PDFs Using InsertPages



Issue
How do I combine multiple PDFs into one PDF using Visual Basic?
Solution
This record contains VisualBasic code to demonstrate AcroExch.PDDoc InsertPages.

As far as InsertPages is concerned, the tricky part is to remember that the page number you will be inserting after is -1; in other words, you want to insert these pages before page 0, which is the first page of the document.

Private Sub Command1_Click()
Dim b As Boolean

Dim AcroPDDoc As CAcroPDDoc
Dim PDDoc As CAcroPDDoc

Set AcroPDDoc = CreateObject("AcroExch.PDDoc")
Set PDDoc = CreateObject("AcroExch.PDDoc")

b = PDDoc.Open("c:\testinsertpages.pdf")
b = AcroPDDoc.Open("c:\Tips.pdf")
b = AcroPDDoc.InsertPages(0, PDDoc, 0, 1, False)
b = AcroPDDoc.Save(1, "c:\Tips.pdf")

End Sub

PDF Programming

A website for PDF programming help

Link is

http://www.nk-inc.com/blog/?page=2

Friday, October 16, 2009

Easily Create Loading GIF's for free

Here is a website to create a Loading GIF and save it to your desktop very easily. Give it a try ?? Click Here

A few samples below are



Another one

Wednesday, October 14, 2009

Disable Autorun of CD's,Pendrives etc

Here is the registry edit that can be done to disable the auto run feature in windows.
  1. Go to RUN type "Regedit".
  2. Go to Hkey_current_user/Software/Microsoft/windows/currentversion/policies/Explorer
  3. Add DWORD "NoDriveTypeAutoRun
  4. Edit the Value to Hexadecimal "FF"
You are set now the auto run is disabled.

Tuesday, October 6, 2009

Query to find no of multiple columns

SELECT id, COUNT(id) AS NumOccurrences
FROM Driver_History
GROUP BY id
HAVING (COUNT(id) = 2)


This above query gives all the rows that have same id's.