|
Hi All,
I want to round a number using the formula in crystalreports
I did it using round(xxx,0) but nothing happened still it continued with 2 decimal places....
What should i want to do now. What might be wrong ...
Can anyone help me..
Thanks in advance,
|
|
|
|
|
How To Implement Custom Rounding Procedures
http://support.microsoft.com/default.aspx?scid=kb;EN-US;196652
|
|
|
|
|
I am a web developer and new to windows applications(VB). I have a client that wants a windows application with buttons that links to his various websites. He is not happy with the linklabel method and wants buttons to link to his sites when clicked on. Can anyone help with a sample code for buttons in a windows form to link to various url's.
Trevor
|
|
|
|
|
I'm assuming you want to launch a new browser window when the button is clicked?
In either case, your code is going to go into the button Click event handler. In the Form designer, just double-click the button and an enpty Click event handler will be created for you. Then just drop the code in that to launch a new browser:
Dim startBrowser As New Process()
startBrowser.StartInfo.UseShellExecute = True
startBrowser.Start("http://www.codeproject.com")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you, this is what I was loooking for.
Trevor
|
|
|
|
|
The code given below is not working.....
Dim ds1 As New DataSet()
Dim adap As New OleDbDataAdapter()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con1 As New OleDbConnection ("Provider=SQLOLEDB.1; User ID=sa;Initial Catalog=pubs;Data Source=.;password=;")
Dim com As New OleDbCommand("select name from student where roll = ?", con1)
ds1.Clear()
adap.SelectCommand.Parameters("roll").Value = TextBox1.Text
adap.SelectCommand = com
adap.Fill(ds1, "student")
TextBox2.Text = ds1.Tables("student").Rows(0).Item("name")
End Sub
End Class
|
|
|
|
|
Hi,
If ur using SQL Database than rather than going for OLEDB object u should use SQLDB object.....Try this code
Imports System.Data.SqlClient
..............
................
Dim ds1 As New DataSet()
Dim adap As New SqlDataAdapter()
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con1 As New SqlConnection("Data Source=(local); User ID=sa;Initial Catalog=pubs;password=;")
Dim com As New SqlCommand("select name from student where roll = @Roll", con1)
ds1.Clear()
adap.SelectCommand.Parameters.Add("@Roll", TextBox1.Text.trim)
adap.SelectCommand = com
adap.Fill(ds1, "student")
TextBox2.Text = ds1.Tables("student").Rows(0).Item("name")
End Sub
........................
........................
I hope this will help u.............:->
Regards,
Ritesh
|
|
|
|
|
Thanks for your reply...
But I m using oracle as backend.
Please advise.
|
|
|
|
|
When a dataset is created by code (Untyped) the
Datatable.find(Textbox1.text)
Find method is not working...
But when dataset is created by Wizard, it is working fine..
Why ????
|
|
|
|
|
Hi,
I guess there is no method like "Find" for Datatable Object....
u can use
drFoundRow = Datatable.Rows.find(Textbox1.text.Trim)
to get the appropriate Row.
Regards,
Ritesh
|
|
|
|
|
I m exactly using this code..
But when I use untyped dataset
dim ds as dataset
it gives error..
I f i take dataset from controls(toolbox) which is the typed sataset..
It is working fine.
I wanted to know .. why ???
Thanks in advance for your reply
Suman Singh
|
|
|
|
|
What is the main difference between Display member and Valuemember property of a listbox or a combobox.
|
|
|
|
|
Hi,
The very basic difference is that user/Customer can see "DisplayMember" on UI while Developer can work with "Valuemember" which is hidden behind the DisplayMember..
I would like to give u one simple example........let's say ur combobox supposed to show the Country list. when u fetch the records from DB u will select Country name along with it'd ID.(select C_ID,C_Name from country)
Now while showing these records u will show the Country Name on ur UI hance u will set "DisplayMember" of combobox to "C_Country" while doing any DB related thing u will require the ID of the selected Country hence u will set Valuemember with "C_ID"
Now u can access the ID of selected Country using SelectedValue Property of Combobox as cboCountry.SelectedValue Property
I hope this will help u...............:->
Regards,
Ritesh
|
|
|
|
|
hi,
almost 7 years later, you answer helped me understand the difference
|
|
|
|
|
15 years later... Now it helps me a lot. Thank you for this answer. Very clear and concise.
|
|
|
|
|
I want to chech whether a dataset is blank or there are any record in it ?
A sample code will be more helpful.
Thanks
|
|
|
|
|
Hi,
U can check the Dataset or Datatable whether they have any data(Rows) in it as follows..........
If Not dsNewData Is Nothing Then<br />
If dsNewData.Tables.Count > 0 Then<br />
If Not dsNewData.Tables("TableName") Is Nothing Then<br />
'If u want u can check for dsNewData.Tables("TableName").Rows.Count>0<br />
MessageBox.Show("Table has :" & dsNewData.Tables("TableName").Rows.Count & " Rows")<br />
End If<br />
<br />
End If<br />
End If
I hope this will help u..............
Regards,
Ritesh
|
|
|
|
|
I m trying to fetch rows from dataview.
Can anyone help me?
A sample code will be more helpful.
Thanks
|
|
|
|
|
Hi,
U can access the records detail from dataview as follows.......
For intRowIndex = 0 To pi_dtTable.DefaultView.Count - 1<br />
MessageBox.Show(pi_dtTable.DefaultView.Item(intRowIndex).Item("ColName"))<br />
Next
I hope this will help u...........:->
Regards,
Riesh
|
|
|
|
|
Hi Ritesh,
Thanks for your all reply.
Can you please let me know,
what have u declared these variables as:
intRowIndex
pi_dtTable
|
|
|
|
|
hello
Private inrowindex as integer
Private pi_dtTable as datatable
whatever the modifier you want use it
|
|
|
|
|
ok...
dim dv as dataview
dv.rowsfilter = "id like 'C%'
Now i want to fetch one record from this dataview..
Please remember i have done this with datatable and dataset..
Thanks in advance for your reply.
Suman Singh
|
|
|
|
|
Hi i have beening to send the following codes to a printer connected to my pc through an ethernet hub, but i could not be able to print a printer-ready data successfully. it only printed out rubbish value
Can anyone help me here?
(the printer ready data are a series of strings that contain Printer Control language which the printer can understand. It the string has been tested by sending it through a parallel port, and it proved it can be read by the same printer.)
Dim Buffer() As Byte
Dim oEncoder As New System.Text.ASCIIEncoding
Dim oEnc As System.Text.Encoding = oEncoder.GetEncoding(1252)
Buffer = oEnc.GetBytes(Chunk)
Dim client0 As New System.Net.Sockets.TcpClient("169.254.192.155","9100")
Dim stream As System.Net.sockets.NetworkStream = client0.GetStream()
stream.Write(Buffer, 0, Len(Chunk))
client0.Close()
stream.Close()
|
|
|
|
|
Hi,
Could anyone help me. I need to read through a text file to find a certain line of text that remains the same and then change it to a different line of text and save it. I am using VB 6 but having no luck.
If anyone could help it would be great.
Thanks
|
|
|
|
|
Unless the change you make is exactly the same length as what you're replacing, you'll have to read in the entire file, make the change, and write the entire file back out.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|