|
If you want to do things right use stored procedures. Also, any vb.net book has sqlcommand examples.
"People who never make mistakes, never do anything."
My blog
http://toddsnotsoamazinglife.blogspot.com/
|
|
|
|
|
I'm using a VB6 application with an FP Spread control. I need a way to check to see if the date was entered complete and in the right format. This is the idea that I have but does not work:
With fpsScr
If .ActiveCol = 6 And .ChangeMade Then
If .Text <> "##/##/####" Then
MsgBox "The date was not entered correctly. Please try again.",_
vbOKOnly, "Incorrect Date Entry"
End If
End If
End With
Can someone help me?
ryanchk
|
|
|
|
|
If .Text <> "##/##/####" Then
Replace this with:
if IsDate(.Text) then
|
|
|
|
|
thealca,
I appreciate you taking the time te help me. The solution checks to see if the field is a date but I also need to make sure that the date wasn't entered incorrectly, i.e. if someone just enters 5/05 I want to display the message to have them re-enter the date.
ryanchk
|
|
|
|
|
im creating a game cheating/game hacking utility and i was wondering if anyone has any examples of dll injection with vb.net
|
|
|
|
|
No, I doubt you can do that in VB.NET. VB exists to make it easy to write a certain type of application. To do powerful stuff you need C++.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I can't find a simple way to move a folder from one place to another without identical roots (directory.move, file.move), or even better, copy a folder, then paste it into another directory(without identical root).
|
|
|
|
|
I don't know if this is the right place to post this. But i'm new, and i'm very sorry if it's wrong
I have a school project, and must only use VBA
I would like to have VBA, to check if my variable contains any letters, symbols or numbers.
If it is an area code i have to tjek, then i would like to tjek for containing letters and symbols. And if it's a name i would like to tjek for symbols and numbers. Is this possible in VBA?
|
|
|
|
|
Anyone have any code that reads a number of records from a database table into a Dynamic Array?
macca
|
|
|
|
|
you can do two things :
1st way :
use an ArrayList and Add() each element you want...
2nd way :
select sum(column) from table...
then create a simple array (non redimentionable), which size is the length read previously...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks for the reply toxxct, but do you have any example code for this?
macca
|
|
|
|
|
Dim RecordArray() as string
Dim SqlAdap as New sqlAdapter(QueryString,ConnectionString)
Dim RowTable as New datatable
SqlAdap.fill(RowTable)
Dim Myrow as Datarow
redim recordArray(rowtable.rows.count-1) as String
Dim i as integer=0
'If u need to inser all the fields from the row
' u can create two dimensional array
For each myrow in Rowtable.rows
recordArray(i) = myRow(0)
i+=1
next
Mandar Patankar
Microsoft Certified professional
|
|
|
|
|
If I double click on a row in my datagrid I want to bring up another form. How can I trap for the double click?
As I arrow up and down in my datagrid I want the entire row to be highlited not just a single cell. How can I do this?
Thanks for any help provided.
|
|
|
|
|
1.) just handle the DoubleClick event
you may noticed, the doubleClick event will be fired, if you doubleclick on the background of you grid, but not if you click into a cell. when you enter a cell a DatagridTextbox will come to front and catches the doubleclick. solution follows...
2.) you have to define your own columnstyle and override the onpaint-method. in onPaint differ between current row and not current row.
public Class YourColumnStyle
Inherits System.windows.Forms.DataGridTextBoxColumn
Protected Overloads Overrides Sub Edit(...)
' override and do nothing so DatagridTextBox wouldn't appear
End Sub
Protected Overloads Overrides Sub Paint(...)
If Me.DataGridTableStyle.DataGrid.CurrentRowIndex = rowNum Then
Else
End If
End Sub
End Class
how to implement a functional columnstyle is an other story
|
|
|
|
|
Thanks.
I'm a newbee at vb (long time user of FoxPro) but I'll try out your ideas.
When I did this type of thing in FoxPro I created a subclass of a textbox control which had code in its double click event. Then I added this textbox control to each column in my grid. Double clicking in any cell in the grid ran the textbox's double click event. This approach work well. Can I do this same type of thing in vb?
|
|
|
|
|
how to invoke batch file .bat from vb.net
kindly help
|
|
|
|
|
Use the Process[^] class. It's just like launching any other external executable.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Friends i am doing project based on facial biometrics..for this i want to take simple pattern of a face from a image.please give me a idea and your suggestions for developing my project..
|
|
|
|
|
|
Like Colin said, this is MIT research stuff and FAR beyond the scope of what anyone here can explain to you in the forums.
You're only source of information is going to be Google and sites and University classes dedicated to the subject.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to send an email to a number of people. The people I want to send to are stored in a database table. I want to send an email that includes a message and includes an OrderNumber which is stored in the database table. The recipients email address is stored in the database table also.
I am not sure what way to retrieve the information and to send it. I think I should read the information from the table using a sql query such as:
Param = SqlCom.Parameters.Add("@OrderNumber", SqlDbType.VarChar, 4)
Param.Direction = ParameterDirection.Output
Param = SqlCom.Parameters.Add("@MailAddress", SqlDbType.VarChar, 20)
Param.Direction = ParameterDirection.Output
Conn.Open()
SqlCom.ExecuteNonQuery()
Conn.Close()
OrderNumber = Trim(SqlCom.Parameters("@OrderNumber").Value)
RecipientAddress = Trim(SqlCom.Parameters("@MailAddress").Value)
I think I should read it using a loop and the send the mails to a recipient using the following code:
Dim dr As SqlDataReader
While dr.Read()
Mail.To = dr("OrderNumber").ToString()
Mail.Body = TextBox5.Text
Mail.From = "jmcconalogue"
SmtpMail.SmtpServer = "donegal-mail"
SmtpMail.Send(Mail)
End While
dr.Close()
Does anyone know if this will keep looping through the table and keep sending emails to all the recipients listed in the datbase table as there may be quite a few in the table?
Anyone a better way to do this?
macca
|
|
|
|
|
If it is the same e-mail which needs to be send to all the recipients, then why not simply compose one string containing the recipients adresses, seperated by semi-colon's and then place it in the BCC field.
So instead of
While dr.Read()<br />
<br />
Mail.To = dr("OrderNumber").ToString()<br />
Mail.Body = TextBox5.Text<br />
Mail.From = "jmcconalogue"<br />
SmtpMail.SmtpServer = "donegal-mail"<br />
SmtpMail.Send(Mail)<br />
<br />
End While
something along the line of:
dim strRecipients as string<br />
<br />
While dr.Read()<br />
<br />
strRecipients &= dr("OrderNumber").ToString() & ";"<br />
<br />
End While<br />
<br />
Mail.BCC = strRecipients<br />
Mail.Body = TextBox5.Text<br />
Mail.From = "jmcconalogue"<br />
SmtpMail.SmtpServer = "donegal-mail"<br />
SmtpMail.Send(Mail)<br />
(note that the code is just meant to be an exampel of the idea)
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
Hi,
I have a class which is used to store customer information. For each customer there may be multiple contacts. How can I record this in a collection class. I've tried to do so as follows:
<br />
' CCustomerInfo -> stores one customer record<br />
Public CompanyID As Long<br />
Public CompanyName As String<br />
Public CompanyAddress As String<br />
Public CompanyFaxNumber As String<br />
Public GeneralSupportExpiryDate As String<br />
Public HardwareSupportExpiryDate As String<br />
Public Contacts() as String <---- Error here<br />
<br />
' CCustomerInfos -> collection of CCustomerInfo objects<br />
<br />
' this is how I add objects to the collection to the class<br />
' not trying to add contacts() yet as I can't declare it correctly<br />
Public Function Add(CompanyID As Long, CompanyName As String, CompanyAddress As String, CompanyFaxNumber As String, GeneralSupportExpiryDate As String, HardwareSupportExpiryDate As String, Optional sKey As String) As CCustomerInfo<br />
<br />
Dim objNewMember As CCustomerInfo<br />
<br />
Set objNewMember = New CCustomerInfo<br />
<br />
With objNewMember<br />
.CompanyID = CompanyID<br />
.CompanyName = CompanyName<br />
.CompanyAddress = CompanyAddress<br />
.CompanyFaxNumber = CompanyFaxNumber<br />
.GeneralSupportExpiryDate = GeneralSupportExpiryDate<br />
.HardwareSupportExpiryDate = HardwareSupportExpiryDate<br />
End With<br />
<br />
If Len(sKey) = 0 Then<br />
mCol.Add objNewMember<br />
Else<br />
mCol.Add objNewMember, sKey<br />
End If<br />
<br />
Set Add = objNewMember<br />
Set objNewMember = Nothing<br />
<br />
End Function<br />
The error message is as follows:
<br />
"Constants, fixed-length strings, arrays, user-defined types and Declare statements not allowed as Public members of object modules"<br />
Can anyone suggest a way to make this work? Thanks very much in advance.
Sorry for the lengthy post!
dlarkin77
|
|
|
|
|
Well, you can't have any array inside a object you're using in a collection. You might want to try replacing that array with another collection to hold your contacts.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Try using the ArrayList class
|
|
|
|