|
I would guess that because you only have one item in the the list the selected item can't change, there is nothing to change, so the event is never triggered. Try adding a empty item at the top of the list.
only two letters away from being an asset
|
|
|
|
|
#1: A change event will never fire if there is only one choice and it's already selected. Try adding a "Select an item" in the first position.
#2: Separate out the database code into it's own function/method that returns the value returned from the DB.
#3: There is no need to call cmd.ExecuteScalar more than once. Store the value in a variable.
|
|
|
|
|
i was also fce tht problem at last i'd tht
into dropdownlist
i entered a Select field into 0 index thru properties
hope tht'll hepls u
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
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.
|
|
|
|