sandeepparekh9 109 Posting Whiz

here try something like this:

Public Class Form1

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

        Dim item As New ListViewItem '("Harry Potter and the Philosopher's Stone", "J K Rowling")
        item.Text = "Harry Potter and the Philosopher's Stone"
        item.SubItems.Add("J K Rowling")
        ListView1.Items.Add(item)

        item = New ListViewItem
        item.Text = "Harry Potter and the Chamber of Secrets"
        item.SubItems.Add("J K Rowling")
        ListView1.Items.Add(item)

        item = New ListViewItem
        item.Text = "Harry Potter and the Prisoner of Azkaban "
        item.SubItems.Add("J K Rowling")
        ListView1.Items.Add(item)

        item = New ListViewItem
        item.Text = "Harry Potter and the Goblet of Fire"
        item.SubItems.Add("J K Rowling")
        ListView1.Items.Add(item)

        item = New ListViewItem
        item.Text = "Harry Potter and the Order of the Phoenix"
        item.SubItems.Add("J K Rowling")
        ListView1.Items.Add(item)

        item = New ListViewItem
        item.Text = "Harry Potter and the Half-Blood Prince"
        item.SubItems.Add("J K Rowling")
        ListView1.Items.Add(item)

        item = New ListViewItem
        item.Text = "Harry Potter and the Deathly Hallows"
        item.SubItems.Add("J K Rowling")
        ListView1.Items.Add(item)

        ''

        item = New ListViewItem
        item.Text = "Capital"
        item.SubItems.Add("Karl Marx")
        ListView1.Items.Add(item)

        item = New ListViewItem
        item.Text = "Value, Price and Profit"
        item.SubItems.Add("Karl Marx")
        ListView1.Items.Add(item)

        item = New ListViewItem
        item.Text = "HManifesto of Communist Party"
        item.SubItems.Add("Karl Marx")
        ListView1.Items.Add(item)


        'Now lets say i want to group by the Author.. i am only showing 2 authors but there can be hundreds in your application.
        'Here is the automatic function which group the authors automatically

        Dim flag As Boolean = True
        For Each l As ListViewItem In ListView1.Items

            Dim strmyGroupname As String = l.SubItems(1).Text

            For Each lvg As ListViewGroup In ListView1.Groups

                If lvg.Name = strmyGroupname …
Reverend Jim commented: Well written and aesthetically pleasing code. +3
sandeepparekh9 109 Posting Whiz

i see ..

but one workaround can be done like this:
when you declar the start,end colors , give them the Default color values.
like

private Color startColor = Color.Green;
private Color endColor = Color.Blue;
private Color mainColor = Color.Red;

this colors will act as defaults.. i have tested and it's working fine..

vedro-compota commented: ++++++++ +3
sandeepparekh9 109 Posting Whiz

humm.. i have been using this code for quite a while and it works fine..

may be if you can provide full code than i can help you here..

vedro-compota commented: +++++++ +3
sandeepparekh9 109 Posting Whiz
[DefaultValue("Color.White")]
sandeepparekh9 109 Posting Whiz

actually all i needed was the extra border lines which were in not label of windows.
if i have inherited form control then all the event and properties of the original windows Label would not have been available to new control. i would have to make all those properties and events..

sandeepparekh9 109 Posting Whiz

or may be you want a smart Tage ..
like this the one in attachement

sandeepparekh9 109 Posting Whiz

or you can try this:

texbox1.Text =  DataGridView1.SelectedRows(0).Cells(1).Value.ToString()
sandeepparekh9 109 Posting Whiz

hi.. here http://goo.gl/6pz4S

i have made this custom control and provided the smart tag coding also.. i hope it helps ..

vedro-compota commented: ++++++++ +3
sandeepparekh9 109 Posting Whiz

can you show your table's data here??

sandeepparekh9 109 Posting Whiz

.SelectCommand.CommandText = "SELECT Reference_Number, Year, Title, Surname," + _
"FirstName, Date_of_Birth, Origin, Phone, State_Deployed, Facility_Deployed FROM HEALTHWORKERS" + _
"WHERE DESIGNATION = BASIC MIDWIVES"

a silly mistake.. you forgot a space between "FROM HEALTHWORKERS" AND "WHERE"

JUST change your query to :

.SelectCommand.CommandText = "SELECT Reference_Number, Year, Title, Surname," + _
                "FirstName, Date_of_Birth, Origin, Phone, State_Deployed, Facility_Deployed FROM HEALTHWORKERS " + _
                " WHERE DESIGNATION = 'BASIC MIDWIVES'"
sandeepparekh9 109 Posting Whiz

if solved then mark the thread solved.. :)

sandeepparekh9 109 Posting Whiz
sandeepparekh9 109 Posting Whiz

go to this link :http://www.microsoft.com/downloads/en/details.aspx?familyid=B5D1B8C3-FDA5-4508-B0D0-1311D670E336&displaylang=en

and you will find powershell for vista in system requirements section..

sandeepparekh9 109 Posting Whiz

i think you are trying to connect to sqlexress instance of sql 2008 server.

do u have sql 2008 installed???

sandeepparekh9 109 Posting Whiz

here is a small demo of what you can do:

string[] arrData = new string[5];
            arrData[0] = "This";
            arrData[1] = "is";
            arrData[2] = "a";
            arrData[3] = "Demo";
            arrData[4] = "Test";

            string tempString = "";
            foreach (string str in arrData)
            {
                tempString += str + ",";
            }

            tempString = tempString.Substring(0, tempString.Length - 1); //removing last ','

            System.IO.File.WriteAllText("my.csv", tempString);

Contents of my.csv files:

This,is,a,Demo,Test

i hope it helps

sandeepparekh9 109 Posting Whiz

ok.. let's assume that you have a table "tblInvNo" which stores your invoice numbers.. (just for demo)

there is only one column in this table , and that is invno (of type nvarchar)

Let's say the content of Table "tblInvNo" are

AA12345678
AA12345679
AA12345680
BB12345680


As you can see the maximum invoice number here is "BB12345680" .

you can get the max invoice number by following sql Query:

SELECT MAX(invno) FROM dbo.tblInvNo

After you get this max invoice number use the following function to calculate next invoice number:

Public Function IncrementInvoice(ByVal strInvoiceNumber As String) As String

        If strInvoiceNumber.Length <> 10 Then
            Return "Error"
        End If

        Dim strAlphaPart(1) As Char
        strAlphaPart(0) = strInvoiceNumber(0)
        strAlphaPart(1) = strInvoiceNumber(1)

        Dim IntPart As Int64
        IntPart = strInvoiceNumber.Substring(2, 8)


        If IntPart = 99999999 Then
            If strAlphaPart(1) = "Z" Then
                strAlphaPart(0) = Chr(Asc(strAlphaPart(0)) + 1)
                strAlphaPart(1) = "A"

                IntPart = 1

                Return strAlphaPart(0) & strAlphaPart(1) & IntPart.ToString.PadLeft(8, "0")
            Else
                strAlphaPart(1) = Chr(Asc(strAlphaPart(1)) + 1)
            End If

        Else
            IntPart += 1
            Return strAlphaPart(0) & strAlphaPart(1) & IntPart.ToString.PadLeft(8, "0")
        End If

    End Function
'outputs example:
        strTemp = IncrementInvoice("AA99999998") 'Output will be: "AA99999999"
        strTemp = IncrementInvoice("AA00000005") 'Output will be: "AA00000006"
        strTemp = IncrementInvoice("AZ00000007") 'Output will be: "AZ00000008"
        strTemp = IncrementInvoice("AZ99999999") 'Output will be: "BA00000001"

i hope this helps

sandeepparekh9 109 Posting Whiz

here is a solution:

There is a timer class specifically for console or rather non ui app. which is SYSTEM.THREADING.TIMER , you will have to use it.

Module Module1

    Sub Main()

        Dim tmr As System.Threading.Timer
        Dim tmrCallBack As New System.Threading.TimerCallback(AddressOf DoFuntion)
        tmr = New System.Threading.Timer(tmrCallBack, Nothing, 0, 1000) 'do function will be called ever 1 sec.
        Console.ReadLine()

    End Sub

    Public Sub DoFuntion(ByVal state As Object)
        Console.WriteLine("Do Function Called")
    End Sub

End Module
sandeepparekh9 109 Posting Whiz

try placing this code in your Form1:

Public Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub
sandeepparekh9 109 Posting Whiz

i think your InitializeComponent() method in designer is not being called correctly , that's why there is no controls in your form..

check the method.

sandeepparekh9 109 Posting Whiz

are you replacing '-' with ' '(space) ???

replace '-' with ''(nothing , only two quotes)

sandeepparekh9 109 Posting Whiz

use ccleaner to clear junk

http://www.piriform.com/CCLEANER

sandeepparekh9 109 Posting Whiz

vodka

sandeepparekh9 109 Posting Whiz
sandeepparekh9 109 Posting Whiz

1. If all the nations in the world are in debt(am not
joking. even US has got debts), where did all the money go?

2. What is the speed of darkness?

3. If the "black box" flight recorder is never damaged
during a plane crash, why isn't the whole airplane made out of that
stuff?

4. Who copyrighted the copyright symbol?

5. Do fish ever get thirsty?

6. Why are the numbers on a calculator and a phone reversed?

sandeepparekh9 109 Posting Whiz

you will have to make a formula field for it..

create a formula field in you crystal report..

lets say the column in which you want to perform the operation is in Table named Column2.

Then

Replace( Replace(  Replace ({Table.Column2}, "-", "") , "*","") , "^","")

This will remove -,*,^ from it

sandeepparekh9 109 Posting Whiz

try changing statement

Dim loNode As XmlNode

at line 6 to

Dim loNode As XmlNode = nothing
sandeepparekh9 109 Posting Whiz

it is possible..

set

Datagridview1.RowHeadersWidth = 10;

set it to any small number that suits you (but its minimum size is 4.)

sandeepparekh9 109 Posting Whiz

have you added Columns in Datagridview programatically or using designer?

well, one suggestion is this:

change you code

DataGridView1.Rows.Add(item.ServerMachineId)
                                DataGridView1.Rows.Add(item.ServerId)
                                DataGridView1.Rows.Add(item.ServerPort)
                                DataGridView1.Rows.Add(item.ServerStatus)
                                DataGridView1.Rows.Add(item.ServerNumberOfClientsOnline)
                                DataGridView1.Rows.Add(item.ServerMaximumClientsAllowed)
                                DataGridView1.Rows.Add(item.ServerName)

to

DataGridView1.Rows.Add(item.ServerMachineId,item.ServerId,item.ServerPort,item.ServerStatus,item.ServerNumberOfClientsOnline,item.ServerMaximumClientsAllowed,item.ServerName)

i think it should work..

your datagridview row contains the columns like machineid,serverid etc.. this are not rows..

sandeepparekh9 109 Posting Whiz

what is the error? i mean wat kind of error are you getting ?

sandeepparekh9 109 Posting Whiz

if you dont get it.. here i am giving a complete demo project ..

find the attachment