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
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
Why cant you try Crystal reports to generate the reports?
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
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
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?:)
which DB you are using?
check your update statement.
In sql it is like
update Tablename set columnname=yourvalue where condition
Using the joins Get one resultset and fill your adapter with that resultset.
Just concatinate vbcrlf where ever u want to go for new line
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
For i As Integer = 0 To ListBox1.Items.Count-1
ListBox1.SelectedIndex = i
Next
Hi Steve,
Try doing indexing on ur tables it may help you.
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
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
Clear the datatable after adding the row using dt.Clear() method
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
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
What you mean by? you want to take first charecter from each words?
Ya Adatapost, Its nice way actually.. Sorry i forgot that.:)
Using Query ony u want to it? cant u use import export wizard to do that?
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?
Check with autocomplete and autofill property of textbox.
get ur data to Customem list as set the property..
cboProdName.items.add(txtProductname.text)
You want to save the record in db?
one way i can think of is loading the xml to dataset using dataset.readxml
and searching is easy in Dataset.
In design its showing the complete grid in the form?.
in runtime ru setting any width and height property of grid?
how ur passing the date from Front end? as a datetime ? or string?
Whats ur DB datatype for that column???
U have created the same thread twice dont do that.
have you tried what i pasted in the other thread???
Why are you doing selectedindex.tostring()???
its selecteditem.tostring()
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...:)
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
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..
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..
In Query it self you can try something like this?
select count(ColumnName) from Table
group by ColumnName
having Count(ColumnName)>0
Still im not getting ur question. what you mean by MODE?
Isntall your Sql Server on one Server. which is avialble over the network.
how ur installing the application at client end?
do you enabled Scrollbars for the grid?
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.
Dim dv As New DataView
dv = ds.Tables(0).DefaultView
dv.RowFilter = "Ur Expression to filter the row"
Can you please explain in detail..?
you want to write your database code on client side or is it ok to write on server side code?
Use dataview object and filter the dataview object based on the selected value in combobox and assign that value to textbox.
can you please try to check for null value before taking the length
something like
If isnull(sheetContent.Range("A" & exRow).Value2.ToString.Length)
Are you using any database?
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
Write seperate class in webservice, write ur method in that class which u want to hide... call where ever u want it
Dim x As String = "15/Feb/2011"
x = Convert.ToDateTime(x)
try something like this...
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.
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
What u mean by?
be clear