|
im making a contact form in that im maling all information to the provider. but wat method i use im not getting
plz help
|
|
|
|
|
May be u can use this :
Imports System.Net.Mail
|
|
|
|
|
i did use that but when i create my own method named as SENDMAIL it give error of namespace.
should i give u code
|
|
|
|
|
Are you sure the assembly is referenced in your project?
only two letters away from being an asset
|
|
|
|
|
|
you must import "Imports.System.Web.Mail"
Then use this code:
Dim objEmail As New MailMessage<br />
objEmail.To = "To Email"<br />
objEmail.From = "Your Email"<br />
objEmail.Subject = "Your Subject"<br />
objEmail.Body = "Hello"<br />
objEmail.Priority = MailPriority.High<br />
objEmail.BodyFormat = MailFormat.Text<br />
SmtpMail.SmtpServer = "Your SMTP Server"<br />
<br />
Try<br />
SmtpMail.Send(objEmail)<br />
Catch exc As Exception<br />
Throw exc<br />
End Try
This will help you!!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Hello,
I have a CRecordset object for a table .I want to know the number of primary keys in a table alongwith the Column Nos.
can I use IsFieldNullable method for this purpose?
Thanks
Prithaa
|
|
|
|
|
A CRecordset object? There is no such class in the framework. Is this a C++ question?
---
Year happy = new Year(2007);
|
|
|
|
|
Guffa wrote: Is this a C++ question?
MFC if I remember correctly....oh and to answer the question, no - can't use IsFieldNullable for that, since it will give you "false positives"...seem to remeber that you need to look at the props of each in turn for a particular flag, though can't off the top of my head remember what it is...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
And anyway, just because a field is null, it doesn't mean that you can assume that it is part of a key.
|
|
|
|
|
|
Its a JavaScript menus... You can do wonders using JavaScript...
|
|
|
|
|
Looks like a div with a table inside it - nothing too spectacular there
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
InvalidCastException
Conversion from string "A10001" to type integer is not valid
I have a query that returns a dataset from a database table. The field i am using as the criteria for fetching the data is of type Text(or Char).
Whenever i passed a value like "110000" there is no problem. But when i passed a value like "B235KK", THE ERROR ABOVE comes up.
pls help
t.aransiola
|
|
|
|
|
Could you post that code?
|
|
|
|
|
I will post that of the dataset later, but also i have this code as well reporting teh same error
Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
Dim strClientID As String = CType(Session.Item("ClientID"), String) '"00144"
Dim strFormula As String = "{Client.ClientID}='" & strClientID & "'"
CrystalReportViewer1.SelectionFormula = strFormula
Sub
t.aransiola
|
|
|
|
|
ok. this is the second one.
'A class module
'
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.OleDb
Public Class clGlobal
Dim strConn As String = "Provider=Microsoft.Jet.oledb.4.0;Data Source=C:\WebReports\db1.mdb"
Dim oConn As OleDbConnection
Dim oCmd As OleDbCommand = New OleDbCommand
Public Function ValidCustomer(ByVal CustCode As String, ByVal PinID As String) As Boolean
Dim intCount As Integer = 0
Dim strSQL As String = "Select ClientID,CPassword From Client Where "
strSQL &= "ClientID='" & CustCode.Trim & "'"
strSQL &= " AND CPassword='" & PinID.Trim & "'"
oConn = New OleDbConnection
oConn.ConnectionString = strConn
oConn.Open()
With oCmd
.CommandText = strSQL
.Connection = oConn
intCount = .ExecuteScalar
End With
ValidCustomer = False
If intCount > 0 Then
ValidCustomer = True
End If
oConn.Close()
End Function
End Class
t.aransiola
|
|
|
|
|
The Code seems ok... It seems that the ClientID must be of a Numberic Data Type in the Database... Please check the data type of the ClientID.
|
|
|
|
|
Thanks. Ive checked the ClientID in the database. The datatype is ok. And this is the datatype(i.e TEXT) i want to use. What i will do next is to use SQL Server database to see the effect.
I think this is a bug in the .net framework.
t.aransiola
|
|
|
|
|
aransiola wrote: Dim intCount As Integer = 0
Dim strSQL As String = "Select ClientID,CPassword From Client Where "
strSQL &= "ClientID='" & CustCode.Trim & "'"
strSQL &= " AND CPassword='" & PinID.Trim & "'"
oConn = New OleDbConnection
oConn.ConnectionString = strConn
oConn.Open()
With oCmd
.CommandText = strSQL
.Connection = oConn
intCount = .ExecuteScalar
End With
ValidCustomer = False
If intCount > 0 Then
ValidCustomer = True
End If
oConn.Close()
Hey Aran,
ExecuteScalar returns a single scalar value. But your query seems to select ClientID and CPassword. That is not possible in ExecuteScalar. Use Count(ClientID) in the SELECT query.
Your query should be,
Dim strSQL As String = "Select COUNT(ClientID) From Client Where "
strSQL &= "ClientID='" & CustCode.Trim & "'"
strSQL &= " AND CPassword='" & PinID.Trim & "'"
|
|
|
|
|
It's because the string doesn't represent an integer - I'm guessing it's hex? Int.Parse won't convert it for you.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi
I feel one of the Database table column is of type int and you are searching it with varchar type.
Check once the DBColumn Type.
|
|
|
|
|
thanks,
The table column and their type is of type Text. I have checked those areas, the table fields are ok.
I think this problem if from the .net framework. you can search google fo
"Input string not in the correct format"
t.aransiola
|
|
|
|
|
Hi all,
I have GridView which has 7 columns and 2 of them are BoundField columns and others are Template Columns which has Checkbox in it.
Now my problem is that I need to Bind the GridView depending upon the DataBase fields and check or uncheck the checkbox that is if Database has 1 then checkbox should be checked and if 0 then it shouldnt.
Also I need to Update the Database if the checkbox is value is changed.
Please tell me how do I go about this as I am have to do this in ASP.NET 2005 Version.
Thanks in advance..
|
|
|
|
|
you can use code something like
this for finding out what checkbox is checked or unchecked to update the database .based on position u can check checkbox value
<br />
For i As Int16 = 0 To DataGrid1.Items.Count - 1<br />
If CType(DataGrid1.Items(i).Cells(0).Controls(1), CheckBox).Checked Then<br />
<br />
Dim cmd As New SqlCommand("update abctable set changed='abc' where id=" & Val(DataGrid1.Items(i).Cells(1).Text)) <br />
cmd.Connection = conn<br />
conn.Open()<br />
cmd.ExecuteNonQuery()<br />
conn.Close()<br />
End If<br />
Next<br />
<br />
hope this might help you
enjoy..
|
|
|
|