|
sohil masani wrote: i need to know how to create a combo box in datagrid in vb6.
Using the MSFlexGrid? You'd drop a ComboBox on the Form, make it invisible, and show and reposition it when the cell gets the input-focus.
Alternatively, you could use the DataGridView from .NET using the Interop Toolkit[^]
I are Troll
|
|
|
|
|
thanks, but can you please write a source code for it.
|
|
|
|
|
Dear All,
I have a Form in VB .net 2005, on which a calender control is added to select date. I have added a crystal report also in my project. Now I want to add the date dynamically on the crystal report, i.e. if i select a date in calender control placed on the Form, the corresponding date should come/display on the crystal report ( whenever it is generated).
Hope I am clear.
Please note that I want to do this without creating any database to store the dates from the calender control.
Please suggest me how to do this asap.
Regards
R.S.
|
|
|
|
|
Use parameter field for your requirement, assign the parameter value in run time when you give the value by calender control
|
|
|
|
|
Hello Everybody.
it seems that ActiveDs.IADsComputer only accepts a GetObject using the WINNT provider and not the LDAP provider, Thus, the following code is not working, i tried to use it to enumerate computer accounts :
Dim RootDSE As ActiveDs.IADs
Dim oComputer As ActiveDs.IADsComputer
Dim DNC As String
Set RootDSE = GetObject("LDAP://rootDSE")
DNC = RootDSE.Get("defaultNamingContext")
Dim strADsPath As String
Dim ArrayofComputers() As String
Dim i As Integer
Const ADS_SCOPE_SUBTREE = 2
Dim objConnection As New ADODB.Connection
Dim objCommand As New ADODB.Command
Dim objRecordSet As ADODB.Recordset
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT ADsPath FROM 'LDAP://" & DNC & "' WHERE objectCategory='computer'"
Err.Clear
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
i = i + 1
ReDim Preserve ArrayofComputers(i)
strADsPath = objRecordSet.Fields("ADsPath").Value
Set oComputer = GetObject(strADsPath)
'the previous line throws an error
ArrayofComputers(i) = oComputer.Name
objRecordSet.MoveNext
Loop '
As you see, Set oComputer = GetObject(strADsPath) throws an error.
Do i need to revert to the Winnt provider or can i use another interface to get the computer object properties ?
Thanks.
|
|
|
|
|
I was able to bypass the problem by using
Dim oComputer As ActiveDs.IADs
and
oComputer.getinfo
oComputer.get("name")
oComputer.get("operatingSystem") or any other property
|
|
|
|
|
Public Class form_login
Private Sub btn_login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_login.Click
Get_Data()
End Sub
Public Sub Get_Data()
Dim qty As String
Dim cons As String
qty = "SELECT * FROM LOGIN WHERE USER_ID = @USER_ID AND PASSWORD = @PASSWORD"
cons = "Provider=Microsoft.Jet.OLEDB.4.0;data source=login.mdb"
Dim con As New OleDbConnection()
con.ConnectionString = cons
Dim com As New OleDbCommand()
com.CommandText = qty
Dim da As New OleDbDataAdapter()
da.SelectCommand.Parameters.AddWithValue("@USER_ID", txt_user_id.Text)--------error occurs on this line---- da.SelectCommand.Parameters.AddWithValue("@PASSWORD", txt_password.Text)
Dim dt As New DataTable
da.Fill(dt)
If dt.Rows.Count > 0 Then
Success.user_id = dt.Rows(0)("USER_ID").ToString
Me.Hide()
Success.Show()
End If
End Sub
End Class
Please help me out of thhis
|
|
|
|
|
Have you tried to change the constructor for the data adapter to;
Dim da as New OleDbDataAdapter(qty,cons)
Which would negate the need for con or com
OR
dim com as NewOleDbCommand
com.connection = con
Dim da as New OleDbDataAdapter(com)
Just think your referencing and constructors need a tidy up and the problem will be fixed.
|
|
|
|
|
Ur ans was CoOl But if fix the Data Adapter Then It will show another exception in
da.fill(dt) //Could not find file 'D:\Login\Login\Login\bin\Debug\login.mdb'.
|
|
|
|
|
See here
You should put your connectionsstrings in your app.config
|
|
|
|
|
Your data source property in the connection string is being locally referenced to the working directory.
You need to fully qualify the file name and path in this setting to ensure it is correctly found.
data source=login.mdb
change to
data source=x:\thefolderpath\morepath\login.mdb
|
|
|
|
|
thx daveauld I fix iT!??
Thx ALot!?
|
|
|
|
|
hi
set the connection object 'con' to the command object e.g
com.Connection = con
do not forget to close the connection e.g. con.Close() aftre the dt.Fill(dt) call.
regards
|
|
|
|
|
Dear Freind,
This is Ganesh Joshi,working as a Beginner of vb.net Developer,i have used a datagrid on a form and also a command button.On the commant button click event a text Box is being open.
My Requirement : If I type any value in text Box then Datagrid Should Be filtered as per given value of.
If I type in text box raj then focus should goes on particular raj name grid.
|
|
|
|
|
That is too generic a question and it is not clear exactly what you are trying to filter. Where is the datasource, is it attached to a database query etc.
Try to explain a bit more of the specifics if you want help.
|
|
|
|
|
Dear All,
I greated small application in VisualStudio2005 to send email with attach file to all my company's customer which take their email from database. So the sending mail process is in loop.
I tested lot time . i change their mail to my mail and friends for test. When i click button "Send Mail" it process is complete but i and friend didn't get any mail.
Note: our company has to usedd mail server as well. I created a Function like bellow:
and Function bellow i imports name space or reference ready.
What is issue of this prople?
Please give me idea or solution. thanks
Under is my function which created.
Function SendEmail(ByVal mBody As String, ByVal mSubject As String, ByVal mFrom As String, ByVal mTo As String, Optional ByVal mCC As String = "", Optional ByVal mBCC As String = "", Optional ByVal pDisplayName As String = "", Optional ByVal pIsBodyHtml As Boolean = False, Optional ByVal pPriority As MailPriority = MailPriority.Normal, Optional ByVal AttPath As String = "") As Integer
Dim Mail As New System.Net.Mail.MailMessage
Dim counter As Integer = 0
Dim MailAddList() As String
Dim MailList As String
Dim Smtp As New SmtpClient
Try
With Mail
.From = New System.Net.Mail.MailAddress(mFrom.Trim, pDisplayName)
'---- Insert Recepient mail(To) ----
MailAddList = Split(mTo, ";")
For Each MailList In MailAddList
.To.Add(MailList)
Next
.Priority = pPriority
.IsBodyHtml = pIsBodyHtml
'---- Insert CC ----
If mCC <> "" Then
MailAddList = Split(mCC, ";")
For Each MailList In MailAddList
'.To.Add(MailList)
.CC.Add(MailList)
Next
End If
'---- Insert Bcc ----
If mBCC <> "" Then
'.Bcc.Add(mBCC.Trim)
MailAddList = Split(mBCC, ";")
For Each MailList In MailAddList
.Bcc.Add(MailList)
Next
End If
.Subject = CStr(mSubject).Trim
.Body = mBody.Trim
.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
'Atach File
AttFileName = New Attachment(AttPath)
Mail.Attachments.Add(AttFileName)
End With
Smtp.Host = CStr("company.test.com.kh") 'It's replace the IP
Smtp.Port = 25
Dim myCredential As New System.Net.NetworkCredential("UserName", "Password")
Smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis
Smtp.Credentials = myCredential
Smtp.Send(Mail)
'----- Delay process 10seconds ------'
System.Threading.Thread.Sleep(10000)
'-----------------------------------'
Return 0
Catch ex As Exception
ErrorMessage = ex.Message
Return -1
Finally
If Mail IsNot Nothing Then Mail.Dispose()
Mail = Nothing
Smtp = Nothing
End Try
End Function
VB.Net
modified on Sunday, January 17, 2010 10:09 PM
|
|
|
|
|
Can you reformat your original post and stick the code in a pre block? that would make it easier to read for a starter. also sort out your blocks.
|
|
|
|
|
Function SendEmail(ByVal mBody As String, ByVal mSubject As String, ByVal mFrom As String, ByVal mTo As String, Optional ByVal mCC As String = "", Optional ByVal mBCC As String = "", Optional ByVal pDisplayName As String = "", Optional ByVal pIsBodyHtml As Boolean = False, Optional ByVal pPriority As MailPriority = MailPriority.Normal, Optional ByVal AttPath As String = "") As Integer
Dim Mail As New System.Net.Mail.MailMessage
Dim counter As Integer = 0
Dim MailAddList() As String
Dim MailList As String
Dim Smtp As New SmtpClient
Try
With Mail
.From = New System.Net.Mail.MailAddress(mFrom.Trim, pDisplayName)
'---- Insert Recepient mail(To) ----
MailAddList = Split(mTo, ";")
For Each MailList In MailAddList
.To.Add(MailList)
Next
.Priority = pPriority
.IsBodyHtml = pIsBodyHtml
'---- Insert CC ----
If mCC <> "" Then
MailAddList = Split(mCC, ";")
For Each MailList In MailAddList
'.To.Add(MailList)
.CC.Add(MailList)
Next
End If
'---- Insert Bcc ----
If mBCC <> "" Then
'.Bcc.Add(mBCC.Trim)
MailAddList = Split(mBCC, ";")
For Each MailList In MailAddList
.Bcc.Add(MailList)
Next
End If
.Subject = CStr(mSubject).Trim
.Body = mBody.Trim
.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
'Atach File
AttFileName = New Attachment(AttPath)
Mail.Attachments.Add(AttFileName)
End With
Smtp.Host = CStr("company.test.com.kh") 'It's replace the IP
Smtp.Port = 25
Dim myCredential As New System.Net.NetworkCredential("UserName", "Password")
Smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis
Smtp.Credentials = myCredential
Smtp.Send(Mail)
'----- Delay process 10seconds ------'
System.Threading.Thread.Sleep(10000)
'-----------------------------------'
Return 0
Catch ex As Exception
ErrorMessage = ex.Message
Return -1
Finally
If Mail IsNot Nothing Then Mail.Dispose()
Mail = Nothing
Smtp = Nothing
End Try
End Function
VB.Net
|
|
|
|
|
I would suggest you first try and break down the issue into smaller chunks and build it up progressively.
1) Start by searching this forum, this has been discussed before many times and there are definitely code samples available (i know because i posted one for sending email via gmail, the process is the same, just different ip's + ports)
2) Is your SMTP port correct? doesn't look like a standard SMTP port (usually 25)
3) Does your SMTP require authentication?
4) Try sending a basic text message first, single hardcoded email address, with no attachments does that work?
Build on it from there.
|
|
|
|
|
I test manually that send to 2 email (yahoo, and gmail) and cc 1 email (our company mail) with attach file. When i check i got in gmail. around 5 or 6 hour i got in our company mail. But about yahoo i don't get it at all.
I don't know that is issue.
If have any solving please let me know.
gold_sovann@yahoo.com
Thanks
VB.Net
|
|
|
|
|
Maybe you have some spam filters as part of the yahoo mail turned on. This is just canning the message.
Did you try sending a basic message without any attachments etc. to yahoo, did this work?
The fact you received the message on gmail and company mail would suggest it is working and it is the mail providers causing the loss of message.
|
|
|
|
|
By the way i tested to send it.
i got testing mail it was in Spam folder not into Inbox.
why is like that?
and when i test send to 7 or 8 customer with loop i did not get mail.
What problem ?
VB.Net
|
|
|
|
|
The problem is your message must look like its is being dumped by all the mail servers because it looks like SPAM. Pure and simple.
You have already said it is sending the messages and they are being received by some account, and not others. And even one appeared in the spam folder.
Change the layout of your message, add more text into the body, have a decent subject, give the attachments meaningful names etc. etc. all these things will reduce the likelihood of it being interrupted as spam.
|
|
|
|
|
Thanks you Dave.
I will try to test it again.
If you have any new of that issue please let me know.
Best regards
VB.Net
|
|
|
|
|
Hi all,
Is it possible to merge two pdf file into one using vb.net and how ?
I google it but it seems. you need to download a pdf utility or third party application. Is there a way in vb.net that will not use some utilities?
Thanks in advance.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|