|
Hi,
The example below is actually for VB.NET, so it may work in VB6 or you may have to adapt it a little, I am not sure.
Public Function SendEmail(ByVal oFrom As String, ByVal oTo As String, ByVal oSubject As String, ByVal oText As String, Optional ByVal oCC As String = "", Optional ByVal oBCC As String = "", Optional ByVal oPri As Integer = 0)<br />
Dim mailmsg As New System.Web.Mail.MailMessage<br />
With mailmsg<br />
.From = oFrom<br />
.To = oTo<br />
.Cc = oCC<br />
.Bcc = oBCC<br />
.Subject = oSubject<br />
.Body = oText<br />
.Priority = oPri<br />
End With<br />
System.Web.Mail.SmtpMail.SmtpServer = "TheNameOfYourSMTPServerHere"<br />
System.Web.Mail.SmtpMail.Send(mailmsg)<br />
End Function
Good luck with it,
Johan
|
|
|
|
|
System.Web.Mail.MailMessage ?
i don't think that's VB 6.0 meterial :P
for VB 6.0 try this (if above doesnt work)
1) add this reference to your project :
Microsoft CDO For Windows 2000 (XP,2000,2003)
2) add this at a startup to your code
Mail.Configuration.Fields.Item("smtpserver") = "smtp.yourserver.com"
Mail.Configuration.Fields.Item("smtpserverport") = 25
3) small example
Dim Mail As CDO.Message
Set Mail = New CDO.Message
Mail.From = "tester@test.com"
Mail.To = "test@test.com"
Mail.Subject = "Subject"
Mail.TextBody = "Hey .."
Mail.Send
|
|
|
|
|
hi
i have a no of text boxes in my form.i want to reset all text boxes by clicking the reset button. in my form..can anybody tell me how can i do it by using a loop(for..next..)nstead of doing textbox1.text="" for each one...??? i am using vb.net
thanks in advance
i m pradip kishore
|
|
|
|
|
dim c as Control
For Each c In Me.Controls
If TypeOf c is TextBox Then
c.Text = ""
End If
Next
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
hi
thanks for your quick response..
i m pradip kishore
|
|
|
|
|
Add the following to your Reset Button click event and it should sort out your issue:
For Each Ctl As Control In Me.Controls<br />
If TypeOf Ctl Is TextBox Then Ctl.Text = String.Empty<br />
Next<br />
Regards,
Martin
|
|
|
|
|
hi
i am having a problem in crystal report.
in the combobox1,i have a list of table name.when i select one name ,then all the data in that table will be inserted into the report table and i ll map all those data to the crystal report.after the report is shown ,then the report table will be blanked..now the problem is that when ever i am accessng the crystal report 1st tme,i can view all the data in the selected table from the combobox1.but on subsequent access to crystal report i cant get the all records inserted(means i always get one record less than the actual value).the code i used is something like below:
Private Sub ButtonReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
da = New OleDb.OleDbDataAdapter("select * from " & ComboBox1.SelectedItem & "", cn)
ds.Clear()
ds.Reset()
da.Fill(ds)
Dim i As Integer
For i = 0 To ds.Tables(0).Rows.Count - 1
Try
cm = New OleDb.OleDbCommand("insert into report values ( '" & ds.Tables(0).Rows(i)(0) & "','" & ds.Tables(0).Rows(i)(1) & "','" & ds.Tables(0).Rows(i)(2) & "','" & ds.Tables(0).Rows(i)(3) & "','" & ds.Tables(0).Rows(i)(4) & "','" & ds.Tables(0).Rows(i)(5) & "' )", cn)
cm.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Next
Dim frm As New LedgerShow()
frm.CrystalReportViewer1.ReportSource = "E:\Accounts_swt\Accounts\Ledger.rpt"
frm.Update()
frm.Show()
'frm.Update()
frm.Refresh()
ds.Clear()
ds.Reset()
Try
cm = New OleDb.OleDbCommand("delete from report", cn)
cm.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
thanks in advance..
its urgernt please..
i m pradip kishore
|
|
|
|
|
Why not simply pass report parameters with the values you need to the report?
Have the datasouce of the report be a view or stored proc.
JaDaar
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones."
Einstein
|
|
|
|
|
hi
thanks for your response.can you show me a code snippet or any link thrugh which i can fulfill my objective
i m pradip kishore from india,working in vb.net & asp.net
|
|
|
|
|
hi
am using vb.net and ms access as database
please try to give a solution for it
pradip kishore
|
|
|
|
|
hello everybody... merry christmas to all of you...
can anyone help me, where to get a third party control for vb.net2005?....
Thank you and Merry Xmas...
nothing is impossible.....
|
|
|
|
|
momooomooomomo wrote: can anyone help me, where to get a third party control for vb.net2005?
What kind of control are you looking for? Try a google search and see what comes up
Merry Christmas to you too
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
a 3d button if there is.. or 3d tab controls... do u have some links that could help me ease on searching from the net?... thank you once again and merry xmas..
nothing is impossible.....
|
|
|
|
|
Google[^]
Just search for ".net windows forms controls" or you can try "Infragistics" or "Dundas", or any other manufacturer that you come acrossed, probably in the ads around CodeProject.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thank you sir... and may you have a very special christmas.....
nothing is impossible.....
|
|
|
|
|
Hi,
I need to link my MS Access database to my vb.net program.
All im looking to do is simply get the user to click a button and by doing so, displaying whats in the MS Access Database.
sounds simple, but I haven't got a clue how to do this, am also struggling to find a tutorial that will teach me how.
I would think its simple as they are both Microsoft products.
Thanks in advance
Jaidev
|
|
|
|
|
There's no such thing as "linking" an Access database, or any other for that matter, you your VB.NET app.
Your VB.NET app can use the database and make queries against it. In order to get the tables, field names, and types in that database, you'll have to query the schema of the database. But, before doing that, I'd suggest learning the basics before getting into something more complicated like this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
well you're right about it being easy
if you also happen to have the latest MSDN (free for the express editions)
you'll find great little tutorials there
anyways all you have to do, is follow the wizard in adding a new data source.
there you'll find options as to what kind of database you'll link to.
(choose from SQL Server, or MS Access database)
After that, it'll import the tables and views from the database.
Also it will ask you if you want to make a copy in your working directory or link it permanently
to the database.
(I suggest the first option which makes a new copy after each compile. Otherwise it;s not easy to distribute an application with it's database hardcoded into the application)
Now the easiest way, is to open your form in design view, and go to your data sources, and simply drag and drop the table you want.
have a look at the options then, and you'll quicly get the hang of it.
hope i could help
|
|
|
|
|
Hi,
Thanks for your reply. However were do I find the 'Adding a new data source' wizard?
Thanks in advance.
Jaidev
|
|
|
|
|
Once you've opened a project in VB.NET (i'm using VB.NET Express 2005)
To the right you will see the "Solution Explorer" Panel
Underneath that, you'll see 2 tabs by default. Solution Explorer and Data sources.
Hit data sources, and if you haven't added any, it should have a link to the wizard to add a new one.
Also in the data sources panel you'll find anything you need to handle your data sources.
Hope i could help
|
|
|
|
|
Hi,
Im using microsoft visualstudio 2003.net, I haven't the options you've listed however I have found a way to add the DB to my program, but I cannot click and drag the fields I need to put into the program, how do I go about putting the fields I require.
I haven't come across a wizard, what I did was click on add exisitng item and then browsed for the DB.
J
|
|
|
|
|
That's right, all the new features I was talking about are new to 2005.
Well i'm sorry to say that I don't know of any simple ways to add a database, other than the same ways used in VB/VBA, where you manually declare a database type and connect to it using a connection string.
here's a good example where you also see how to pull data, like an image and put in on a picturebox.
http://support.microsoft.com/kb/321900/en-us?spid=2965&sid=global
It's much easier in 2005 if you are concidering updating. (Also the 2005 Express editions are free)
|
|
|
|
|
Hello,
In an app I am writing, I have a couple of subs that first make some changes to my form controls, then fire one of two data access routines.
The problem is that before the controls completely change, the data access routine fires and the app doesn't respond while it waits on the data access routine to complete. It's not causing any problems, other than it's not aesthetically pretty.
I thought I would put a wait timer between the control changes and the data access routine, maybe 500 milliseconds.
I can't figure out how to make it work, and none of the samples I've found deal with anything as simple as what I want to do.
Private Sub btnShipConfirms_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShipConfirms.Click<br />
GroupBox1.Text = "Shipping Confirmation Data"<br />
btnShipConfirms.Enabled = False<br />
btnOrderConfirms.Enabled = True<br />
btnSendAll.Visible = False<br />
btnSendAllShip.Visible = True<br />
<br />
'this is where I thought it would make sense to put a timer<br />
Timer1.Interval = 5000<br />
Timer1.Start()<br />
MessageBox.Show("here")<br />
<br />
'run data access routines<br />
CreateShipConfirmTempTable()<br />
RefreshShipConfirm()<br />
Thanks for any help.
Mike
|
|
|
|
|
That's not what a Timer is for. A Timer fires off an event every interval milliseconds so you can do something repeatedly.
If you want the controls to change before your data-intensive code starts, just put in a Application.DoEvents() so the controls have a chance to get and process their paint events.
Private Sub btnShipConfirms_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShipConfirms.Click
GroupBox1.Text = "Shipping Confirmation Data"
btnShipConfirms.Enabled = False
btnOrderConfirms.Enabled = True
btnSendAll.Visible = False
btnSendAllShip.Visible = True
Application.DoEvents()
'run data access routines
CreateShipConfirmTempTable()
RefreshShipConfirm()
.
.
.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how i can use the usb port in vb.net?
|
|
|
|