Pgmer 50 Master Poster Featured Poster

Hi Shantanu,

I Agree with you, but still the good practice is to write the stored procudures rather than writing the query in front end. and as xreyuk is new to programing let him start with best practices only..

Regards
PGMER

Pgmer 50 Master Poster Featured Poster

Why cant you try Crystal reports to generate the reports?

Pgmer 50 Master Poster Featured Poster
Public Class Form1

    Private Sub RichTextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles RichTextBox1.KeyPress
        
        RichTextBox1.Text = RichTextBox1.Text & " Not available "
        RichTextBox1.Select(RichTextBox1.Text.Length, 0)

    End Sub
End Class
Pgmer 50 Master Poster Featured Poster
Dim cn As SqlConnection
        Dim strCnn As String ="Your connection string"
        cn = New SqlConnection(strCnn)
        cn.Open()
        Dim comm As New SqlCommand("Ur procedure name", cn)
        comm.CommandType = CommandType.StoredProcedure
        Dim da As New SqlDataAdapter(comm)
        Dim ds As New DataSet
        da.Fill(ds)

Then use the data set to assign to ur variables

Pgmer 50 Master Poster Featured Poster

You can write the stored procedure in ur sql server and using ADO.NET objects you can query and get the information, or else in your code only you can write the query.
you need code or just an idea?:)

Pgmer 50 Master Poster Featured Poster

which DB you are using?
check your update statement.
In sql it is like
update Tablename set columnname=yourvalue where condition

Pgmer 50 Master Poster Featured Poster

Using the joins Get one resultset and fill your adapter with that resultset.

Pgmer 50 Master Poster Featured Poster

Just concatinate vbcrlf where ever u want to go for new line

Pgmer 50 Master Poster Featured Poster
Dim x As Integer = 0
        Dim j As Integer = 0
        For i As Integer = 0 To ListBox1.Items.Count - 1
            For j = 0 To 50
                j = j + 1
                If j < 50 Then
                    Application.DoEvents()
                End If
            Next
            ListBox1.SelectedIndex = i
            MsgBox(ListBox1.SelectedIndex.ToString)
        Next
Pgmer 50 Master Poster Featured Poster
For i As Integer = 0 To ListBox1.Items.Count-1
                ListBox1.SelectedIndex = i
              Next
Pgmer 50 Master Poster Featured Poster

Hi Steve,

Try doing indexing on ur tables it may help you.

Pgmer 50 Master Poster Featured Poster
Dim strS As String() = Nothing
            Dim actaulstring As String = ""
            strS = RichTextBox1.Text.Split("=")
            actaulstring = strS.GetValue(2)
            strS = actaulstring.Split(">")
            actaulstring = strS(0)
            TextBox2.Text = actaulstring
Pgmer 50 Master Poster Featured Poster
Dim strS As String() = Nothing
            Dim actaulstring As String = ""
            strS = RichTextBox1.Text.Split("=")
            actaulstring = strS.GetValue(1)
            strS = actaulstring.Split(">")
            actaulstring = strS(0)
            TextBox2.Text = actaulstring
Pgmer 50 Master Poster Featured Poster

Clear the datatable after adding the row using dt.Clear() method

Pgmer 50 Master Poster Featured Poster
Dim myConnection2 As New SqlClient.SqlConnection()
        Dim myCommand2 As New SqlClient.SqlCommand()

        Dim da As SqlDataAdapter
        Dim ds As New DataSet


        Try
            ' lstReader.Items.Clear()

            myConnection2.ConnectionString = "Data Source=User-PC;Initial Catalog=patientrecords;Integrated Security=True"

            myConnection2.Open()

            myCommand2.CommandText = "SELECT [Child_First_Name], [Child_Last_Name], [Child_DOB] FROM Parent_Details " & _
            "WHERE [Parent_First_Name] = '" & txtFName.Text & "'  AND " & _
            " [Parent_Last_Name] = '" & txtLName.Text & "' order By [Child_First_Name], [Child_Last_Name], [Child_DOB] ; "




            myCommand2.Connection = myConnection2
            da = New SqlDataAdapter(myCommand2)
            da.Fill(ds)
            If ds.Tables.Count > 0 Then
                DataGridView1.DataSource = ds
            Else
                MsgBox("Record does not exist")
            End If
          

        Catch el As Exception
            Console.WriteLine(el.Message)

        Finally
            If myConnection2.State = ConnectionState.Open Then
                myConnection2.Close()
            End If
        End Try
Pgmer 50 Master Poster Featured Poster

Then get that data into dataview sort or find you can do, even in dataset you can find for perticlar record before assigning to the grid

Pgmer 50 Master Poster Featured Poster

What you mean by? you want to take first charecter from each words?

Pgmer 50 Master Poster Featured Poster

Ya Adatapost, Its nice way actually.. Sorry i forgot that.:)

Pgmer 50 Master Poster Featured Poster

Using Query ony u want to it? cant u use import export wizard to do that?

Pgmer 50 Master Poster Featured Poster

Use data adapter and dataset objects and fill dataset with records and then

Datagridview.datasource=dataset.table("Tablename").

What if user wants to search only on first name or only on last name? If eaither of textbox are emty will ur sql statement gives u record?

Pgmer 50 Master Poster Featured Poster

Check with autocomplete and autofill property of textbox.
get ur data to Customem list as set the property..

Pgmer 50 Master Poster Featured Poster
cboProdName.items.add(txtProductname.text)

You want to save the record in db?

Pgmer 50 Master Poster Featured Poster

one way i can think of is loading the xml to dataset using dataset.readxml
and searching is easy in Dataset.

Pgmer 50 Master Poster Featured Poster

In design its showing the complete grid in the form?.
in runtime ru setting any width and height property of grid?

Pgmer 50 Master Poster Featured Poster

how ur passing the date from Front end? as a datetime ? or string?
Whats ur DB datatype for that column???

Pgmer 50 Master Poster Featured Poster

U have created the same thread twice dont do that.
have you tried what i pasted in the other thread???

Pgmer 50 Master Poster Featured Poster

Why are you doing selectedindex.tostring()???
its selecteditem.tostring()

Pgmer 50 Master Poster Featured Poster

Where you got the error?
Can you debug code when Selected index changed of combo? is Dataset is loading properly? dv has any rows before filtering the records?

i cant debug ur code from here...:)

Pgmer 50 Master Poster Featured Poster
Try
            Dim x As String = ""
            x = ComboBox1.SelectedValue.ToString
            dv.RowFilter = "Customer= '" & "x " & "'"
            TextBox1.Text = dv.Table(0).Item(1).ToString
        Catch ex As Exception

        End Try
Pgmer 50 Master Poster Featured Poster

In combobox Selectedindexchanged event do the rowfilter on DV and dv will give you on row select the column you want to assign to textbox and assign it..

Pgmer 50 Master Poster Featured Poster

Have the Dv in form level variable or else in selectedindexchanged event of combobox load the records again and do the rowfilter on dataview and assign the value to textbox..

Pgmer 50 Master Poster Featured Poster

Same thread in this forum only.. u may get some idea
http://www.daniweb.com/forums/thread347138.html

Pgmer 50 Master Poster Featured Poster

In Query it self you can try something like this?

select count(ColumnName) from Table
group by ColumnName
having Count(ColumnName)>0
Pgmer 50 Master Poster Featured Poster

Still im not getting ur question. what you mean by MODE?

Pgmer 50 Master Poster Featured Poster

Isntall your Sql Server on one Server. which is avialble over the network.

how ur installing the application at client end?

Pgmer 50 Master Poster Featured Poster

do you enabled Scrollbars for the grid?

Pgmer 50 Master Poster Featured Poster

Is Product Id is primary key? if yes then have that key as forein key in
Sell product table. When item is added to Register product table add the product key
and other valu in Sell product table. join the two atbles and get the records and load to ur combobox.

Pgmer 50 Master Poster Featured Poster

Ok. Congrats... but why u open the new thread for this? to just to tell all that u created notepad in vb.net?

Pgmer 50 Master Poster Featured Poster
Dim dv As New DataView
            dv = ds.Tables(0).DefaultView
            dv.RowFilter = "Ur Expression to filter the row"
Pgmer 50 Master Poster Featured Poster

Can you please explain in detail..?

Pgmer 50 Master Poster Featured Poster

you want to write your database code on client side or is it ok to write on server side code?

Pgmer 50 Master Poster Featured Poster

Use dataview object and filter the dataview object based on the selected value in combobox and assign that value to textbox.

Pgmer 50 Master Poster Featured Poster

can you please try to check for null value before taking the length

something like

If isnull(sheetContent.Range("A" & exRow).Value2.ToString.Length)
Pgmer 50 Master Poster Featured Poster

Are you using any database?

Pgmer 50 Master Poster Featured Poster
Private Function ValidateEmail(ByVal EmailAddress As String) As Boolean
        Try
            If EmailAddress.Trim.Length = 0 Then
                MsgBox("Please enter the email Address")
                Return False
            End If
            Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"

            Dim emailAddressMatch As Match = Regex.Match(EmailAddress, pattern)
            If emailAddressMatch.Success Then
                Return True
            Else
                MsgBox("Please enter the valid email address")
                Return False
            End If


        Catch ex As Exception

        End Try
    End Function
Pgmer 50 Master Poster Featured Poster

Write seperate class in webservice, write ur method in that class which u want to hide... call where ever u want it

Pgmer 50 Master Poster Featured Poster
Dim x As String = "15/Feb/2011"
   x = Convert.ToDateTime(x)

try something like this...

Pgmer 50 Master Poster Featured Poster

Deploy ur webservice on server, goto add reference in ur VS add the web reference to ur project and then instaniate the webservice object then you can access the web method.

Pgmer 50 Master Poster Featured Poster

In database the datatype is Datetime and ur passing String from Front end so its causing the error. Either make the datatype as varchar in DB or pass the date from front end

Pgmer 50 Master Poster Featured Poster

What u mean by?
be clear