|
Excellent,thanks.
My goal in life is to be the kind of person my dog thinks I am.
|
|
|
|
|
Hi!
I have this code:
<br />
Dim mailMsg As New MailMessage("webmaster1@myhost.com", "webmaster2@xxxxxxxxx.com", "Test", "Test and Spam")<br />
Dim mysmtp As SmtpClient<br />
mysmtp = New SmtpClient("mail.myhost.com")<br />
<br />
Try<br />
mysmtp.Send(mailMsg)<br />
MessageBox.Show("Sended!", _<br />
"Email Send Status", MessageBoxButtons.OK, _<br />
MessageBoxIcon.Information)<br />
Catch exp As Exception<br />
MessageBox.Show("Error:" & exp.Message, _<br />
Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
End Try<br />
In Microsoft Visual Studio 2005, VB.NET
How I can use also a username and the passwoed?
Thanks!
My site: www.logicpc.co.il
|
|
|
|
|
I have added one line to your code for username and password
'Your Code
Dim mailMsg As New MailMessage("webmaster1@myhost.com", "webmaster2@xxxxxxxxx.com", "Test", "Test and Spam")
Dim mysmtp As SmtpClient
mysmtp = New SmtpClient("mail.myhost.com")
Try
'Add this code
mysmtp.Credentials = New System.Net.NetworkCredential(username, password)
'
mysmtp.Send(mailMsg)
MessageBox.Show("Sended!", _
"Email Send Status", MessageBoxButtons.OK, _
MessageBoxIcon.Information)
Catch exp As Exception
MessageBox.Show("Error:" & exp.Message, _
Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
|
|
|
|
|
Thanks for you! Worked.
My site: www.logicpc.co.il
|
|
|
|
|
i have a table that has no Triggers and all the Fields in my table are nullable and have an Identity Column that is no giving me problem.
am inserting data from my vb.net frontend to my table. sometimes users dont have anything to input, so i want to allow my Adapter to input Null in the dataset when the user has not inserted in data in the text. i used the dragg and drop technique(draging table into the form) here is my SQl statement
<br />
SELECT NUM_KEY, EXTENSION, CELL_ID, ACTUAL_EXTENT, PROP_CATEGORY_ID, LIS_KEY, FUNC_KEY, RATEABLE, GEOCODE, NON_DISCREET_VALID, PROPERTY_ID FROM PROPERTY<br />
i want all this fields to accepts null values in the dataset, because i know that when i run the update function, my table wont complain because all this fields accepts Null values.
Thanks
Vuyiswa
|
|
|
|
|
You should validate your form and avoid null in the DB where-ever possible.
Why do you want null and not an empty string ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Am Sorry to put it that way, i meant Empty string, but the thing sometimes the user might enter something, what if the user does not enter anything?
Vuyiswa
|
|
|
|
|
Then the user has actually entered an empty string. An empty string is entered into the database exactly the same as a string of length greater than 0.
An empty string is most certainly not null.
|
|
|
|
|
Thanks Dave,
i have solved the Problem , by converting everting input from a user to string, if the user enters nothing then, it wil be converted to empty String , and in my table it will be null.i have put this code in the Textchanged event
<br />
<br />
me.Tostring<br />
<br />
Thanks
Vuyiswa
|
|
|
|
|
Vuyiswamb wrote: me.Tostring
Uhhh...Me refers to the instance of the class it appears in. If you used Me inside a Form class, you executed .ToString() on a Form .
|
|
|
|
|
i made a delegate of one sub and sent its method.methodhandle.value to a sub in a VisualFortran Dll.
the sub in VisualFortran creates an interface to work with this sub and calling it from fortran.
this works in vb6 when i send the (addressof sub) to visual fortran but it does not work when the delegate.method.methodhandle.value in vb.net is sent to the fortran dll.
i know intptr is not even a CLS-Comapliant but i recieve the error "protected memory ..."
A.E.K
|
|
|
|
|
Without seeing your code that declares the delegate, the function your calling, and the callback function in your code, it's kind of hard to diagnose. This[^] is about the only thing anyone can recommend.
|
|
|
|
|
This is the code in VB.NET
Private Declare Function dll1 Lib "FileAddress" (ByVal ptr As Integer) as Single<br />
Public Delegate Function del1(ByVal p As Single) As Single<br />
Dim g1 As del1 = AddressOf proc1<br />
Function proc1(ByVal p As Single) As Single<br />
Return p ^ 2<br />
End Function
Here is the function Call(in.Net):
dll1(g1.Method.MethodHandle.Value)
and here the code in VisualFortran:
Real function dll1(F)<br />
!dec$ attributes dllexport ::dll1<br />
!dec$ attributes alias :'dll1'::dll1<br />
<br />
interface <br />
real function F(x)<br />
real x<br />
end<br />
end interface<br />
<br />
end
and I recieve this Error:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Notice that i call back a function in .Net from Visual Fortran (not another .Net)
thanx a lot
A.E.K
|
|
|
|
|
Hi
I did an add-in for vs.NET 2003 and that element appeared in menu but I have a problem how to connect it with program I'd like to write. Which method is responsible for calling and where to set it? Could you help me or point out the webside with description?
Thank you for replays
Kasia
|
|
|
|
|
What is this "connection" supposed to do? What's it supposed to carry? What does this plugin do?
|
|
|
|
|
I added add-in into the menu. I don't know how to bind this with form. How to call it? Which method is responsible for doing it?
Katarzyna
|
|
|
|
|
You haven't answered any of my questions. The is information that anyone MUST have to tell you anything useful.
Katarzyna_ wrote: I don't know how to bind this with form.
A plugin to Visual Studio alters the functionality of Visual Studio, NOT your form.
Katarzyna_ wrote: How to call it? Which method is responsible for doing it?
Your projects code doesn't call an AddIn to Visual Studio. There's nothing to "bind" to. There is no one method for calling an Add In.
Or maybe I'm confused as to what this Add In is doing. It's impossible to say because you haven't said ANYTHING about what the plugin does.
|
|
|
|
|
I made an addin and it appeared in menu in Visual Studio. Now I'd like to have a possibility to choose that element in menu by click and call a form which I did. Simple path. Mayby it is imposible to do it. I just don't know.
I read about methods like:
OnConnection
OnDisconnection
OnStartupComplete
OnAddInsUpdate
OnBeginShutdown
but I don't know how to use it.
|
|
|
|
|
Which interface did you implement in your addin?
|
|
|
|
|
I've not implemented any interfaces in my addin yet because I don't know how to do it. It is just the problem I'd like sb to help me with.
|
|
|
|
|
|
Ahhhhh how to explain...
I have MDI Form with menu that looks like this:
_________________________________
|File░░Edit░░View░░Help░░░░░░░░░░░░|
|Open░░|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|Exit░░░|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|-------|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
The Bold Text File item is selected...
And i have other Child form which i shown when i open file...
The child form menu looks like this:
_________________________________
|File░░Edit░░░░░░░░░░░░░░░░░░░░░░░|
|Save░░░░░░|░░░░░░░░░░░░░░░░░░░░|
|Save as...░░|░░░░░░░░░░░░░░░░░░░░|
|------------|░░░░░░░░░░░░░░░░░░░░|
|Close░░░░░░|░░░░░░░░░░░░░░░░░░░░|
|------------|░░░░░░░░░░░░░░░░░░░░|
|░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░|
|░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░|
|░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░|
|░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░|
|░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░|
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
So what i want is that the MDI form looks like this:
That it gets all menu items from child form, and that a child form
doesn't contain any item...
_________________________________
|File░░Edit░░View░░Help░░░░░░░░░░░░|
|Open░░░░░░|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|------------|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|Save░░░░░░|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|Save as...░░|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|------------|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|Close░░░░░░|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|------------|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|Exit░░░░░░░|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|------------|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓|
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
I did this in vb.net 2003 and its working fine buth i cant do that in 2005...
Please help me!!! THANKS!!!!!!!!!!!!!!!
I hope you understand...
|
|
|
|
|
You haven't described how you did it in vb2003 and how it doesn't work vb2005!
So how could we help you?!
|
|
|
|
|
its sample in 2003, you place menu on main form and menu on child form, then you just select what items you want to merge and select replace or add (you can sort items by their indexes) and thats all it works perfect but in 2005 it replaces and duplicates them please help i cant finish any of my projects...
|
|
|
|
|
Private Sub Form_Load()
Dim i As Long, Arr(100) As Long
For i = 0 To 5
Arr(i) = InputBox("Enter the " & i & "th number.", "Number Array")
Next i
MsgBox Arr(0) & " " & Arr(1) & " " & Arr(2) & " " & Arr(3) & " " & Arr(4) & " " & Arr(5)
End Sub
The name is Sandeep
|
|
|
|