|
hi i am really sorry for not sending the proper info, there is no way to attachment, at least i don't know, this is very first time i am on forum.
now,
when i manually use command prompt , go in that perticular directory where my make file reside with the c files to be compiled everything work properly.
now my vb project (with build condition as debug) is at "d:", that time also i am able to go at c:\test folder & able to run make file properly.
here while i use my installed program it doen't work properly.
So while to build setup do i have to take different precaution if yes then plz help me.
the code i have sent you. do it work at your ent or not.
i must thank you , for your trials, to slove my problem
|
|
|
|
|
hi i tried as you say i am watching my current working directory,
curdir(), shows me the same directory (path ) which i entered in textbox1.
but still i am unable to run the make , it gives me the same error.
so it means the problem is in run time
can you guess, what is problem
waiting for reply
|
|
|
|
|
The message you posted isn't a VB Runtime error. It has something to do with your MAKE process that you're launching. You would probably be doing yourself a favor if in your command line to launch the MAKE process, you directed the output to a file to log everything that is going on. You can append > C:\makeoutput.txt to your command line.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi you are write ,this is not a vb dot net run time error.
i try with, redirecting my output to makeoutput.txt
but i still don't understand, how it's work in debug mode.
|
|
|
|
|
hi guys,
i have a vb application in which im reading columns in Xl file and write a error log in seperate xl file .my req is i will read columns in xl file which are mandatory if any of columns are left balnk i have to write to error log by calling another class file.if the col filled then it will write to the success sheet if it is not then it will write to the error sheet.what the prob im facing is i have some validations on reading to cheack whether the value is numeric and it is within limit and all.if the column has letters instead of numeric then the column is taken as null .that's my prob please solve this .it's killing me
with regards,
susa
|
|
|
|
|
any help is greatly appreciated.Thanks
donle
-- modified at 0:15 Wednesday 19th April, 2006
|
|
|
|
|
Help with what? What exactly are you having a problem with?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
If yo want to read/write data have a look at the BCP command line utility
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Need a good Email Validator function...Help me out!
|
|
|
|
|
What do you want to "evaluate"?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dear Dave,
What exactly im looking for is a function in VB .NET to validate an email address inserted into a textbox in windows application forms.
I surfed the web and I found the following code :
Function ValidEmail(ByVal strCheck As String) As Boolean
Dim bCK As Boolean
Dim strDomainType As String
Dim strDomainName As String
Const sInvalidChars As String = "!#$%^&*()=+{}[]|\;:'/?>,< "
Dim i As Integer
bCK = Not InStr(1, strCheck, Chr(34)) > 0 'Check to see if there is a double quote
If Not bCK Then GoTo ExitFunction
bCK = Not InStr(1, strCheck, "..") > 0 'Check to see if there are consecutive dots
If Not bCK Then GoTo ExitFunction
' Check for invalid characters.
If Len(strCheck) > Len(sInvalidChars) Then
For i = 1 To Len(sInvalidChars)
If InStr(strCheck, Mid(sInvalidChars, i, 1)) > 0 Then
bCK = False
GoTo ExitFunction
End If
Next
Else
For i = 1 To Len(strCheck)
If InStr(sInvalidChars, Mid(strCheck, i, 1)) > 0 Then
bCK = False
GoTo ExitFunction
End If
Next
End If
If InStr(1, strCheck, "@") > 1 Then 'Check for an @ symbol
bCK = Len(Left(strCheck, InStr(1, strCheck, "@") - 1)) > 0
Else
bCK = False
End If
If Not bCK Then GoTo ExitFunction
strCheck = Right(strCheck, Len(strCheck) - InStr(1, strCheck, "@"))
bCK = Not InStr(1, strCheck, "@") > 0 'Check to see if there are too many @'s
If Not bCK Then GoTo ExitFunction
strDomainType = Right(strCheck, Len(strCheck) - InStr(1, strCheck, "."))
bCK = Len(strDomainType) > 0 And InStr(1, strCheck, ".") < Len(strCheck)
If Not bCK Then GoTo ExitFunction
strCheck = Left(strCheck, Len(strCheck) - Len(strDomainType) - 1)
Do Until InStr(1, strCheck, ".") <= 1
If Len(strCheck) >= InStr(1, strCheck, ".") Then
strCheck = Left(strCheck, Len(strCheck) - (InStr(1, strCheck, ".") - 1))
Else
bCK = False
GoTo ExitFunction
End If
Loop
If strCheck = "." Or Len(strCheck) = 0 Then bCK = False
ExitFunction:
ValidEmail = bCK
End Function
But I when I copy the code in my application LEFT and RIGHT are shown as SYNTAX ERROR,
do I need to IMPORT sth in order to make them recognized?
Regards,
AmirK1
|
|
|
|
|
You tried to use old VB6, or VBScript code. Left and Right don't exist in the .NET Framework. Trash this code and try something from a more specific Google[^] search, like "vb.net email validation code"
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
This is a school project. I have to use at least one array and two text files to store information in. The problem I have is that once the app closes, all the information in the array is set 0. Can the information in the array persist on exit? And if not, can the information from the text files that are created fill the array when the app opens?
More background info...
This is a project that requires someone to update inventory information for 10 records in an array. Stock# is the same in both text files and I am totaling one field in one of the text files which updates the array by using the text box on the form.
Thank you,
Larry
|
|
|
|
|
An array only lasts for the lifetime of the program. If you want to persist its data when the program ends, you'll need to write it out to a file.
Same thing when the program starts - the array is empty and you'll need to read the data in from the file and populate your array.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Thanks...I think that is where I am confused. I am not sure how to read each line of the txt file to populate the array when the app opens. I am guessing I need to use a For...Next loop but how does I know what line I am on and how to pull each item/column of data and seperate it from the other columns. The array has 5 columns and the text files have 2 columns and 5 columns with one common column.
Is there a function to know how to grab each column per row in the text file...
Lastly this is a school project as I mentioned. Why would you use an array over a database like Access or SQL where it would seem reading and writing data would make more sense.
Thanks in advance!
Larry
-- modified at 10:16 Wednesday 19th April, 2006
|
|
|
|
|
lawrencef14 wrote: Why would you use an array over a database like Access or SQL where it would seem reading and writing data would make more sense.
Last question first - possibly the lecturer/teacher wants you to learn about basic file and array handling. Also for simple applications where not a lot of data is manipulated, storing it in discrete files is fine. When you have a reasonable amount of data or multiple concurrent users of said data, a database of some sort is the way to go.
lawrencef14 wrote: Is there a function to know how to grab each column per row in the text file...
Second question next - yes there is (almost). See next answer.
lawrencef14 wrote: I am not sure how to read each line of the txt file to populate the data. I am guessing I need to use a For...Next loop but how does I know what line I am on and how to pull each item/column of data and seperate it from the other columns. The array has 5 columns and the text files have 2 columns and 5 columns with one common column.
OK, I assume that the files are formatted somewhat like this:
File1: commonvalue1, value2
File2: commonvalue1, value3, value4, value5, value6
Now I won't give exact code here because I'm not on my regular machine and don't have VB etc on this one, but in any case you should be able to lookup the required functions in the VB help files. Here goes... (I found some of this sample code on The Code Project )
Dim dataArray1() As String
Dim fileNumber as Integer
Dim temp As String
fileNumber = FreeFile()
FileOpen(fileNumber, "datafilename.txt", OpenMode.Input, _
OpenAccess.Read)
'EOF() function is used to detect the end of file.
Do While Not EOF(fileNumber)
temp = LineInput(fileNumber)
dataArray1 = Split(temp, ",")
Loop
'Close the file.
FileClose(fileNumber)
That should get you started.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Thank you! That is helpful!
|
|
|
|
|
No problems.... I just re-read my last post and there is a bug - it will continually read in each line of data to the same array effectively trashing the previous line of data. Goes to show you I shouldn't try to do this from memory at midnight
In any case I think you now have the basic idea of how to do it so it shouldn't be too hard to modify.
Regards,
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Yes, what you provided helped a lot and got me to the point where I could fix the issues...
Thanks!!!
Regards!
|
|
|
|
|
Hi,
I've been creating a program in my module that will delete a created SQL server backup files.
Currently, I'm using the so called 'xp_cmdshell' sp to delete those created files. But in the long run, I found out that there's a problem in the deleting these files because the 'xp_cmdshell' coundn't find the specfied file
e.g. master..xp_cmdshell 'del c:\Program Files\Microsoft Sql Server\binn\data\temp00001.bak'.
So, when i used the short path method,
e.g. master..xp_cmdshell 'del C:\PROGRA~1\MI6841~\binn\data\temp00001.bak'
everything works fine. But my problem is, How can i change the long path to short path remotely?
Is there any sp that could help me to translate long path to short path?
By the way, the above code, I just coded it and test it using the SQL Query Analyzer. But my problem is, when i use it in my program.
Im hoping that anyone can help me.
Sincerely,
J.J.
j.j.
|
|
|
|
|
Normally, you wouldn't even put this in your VB code. This is something that you would do from inside a stored procedure or scheduled maintenance job. On top of that, you can also set how far back backups are maintained before being automatically deleted. Soooooo, the question becomes, what are you doing to require you to delete the backup jobs from a VB app by way SQL commands? (I'm assuming this because you posted in the VB.NET Forum...)
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi folks !
In the present code, we use a datagrid as a container to print data from a SQL database. The following gets data (via ODBC) in the SQL database and save it in a DATASET.
Public Function GetDatasetGiveSql(ByVal sqlCmd As String) As DataSet
Dim dataset As New DataSet
odbcCmd.Connection.Close()
odbcCmd = New Odbc.OdbcCommand(sqlCmd, odbcConnection)
odbcAdapt = New Odbc.OdbcDataAdapter(odbcCmd)
odbcCmd.Connection.Open()
odbcAdapt.Fill(dataset)
Return dataset
End Function
Elsewhere in the software, the software builds a query and sends it to the database like this:
dsCommand = sql.GetDatasetGiveSql(cmd)
DataGridCommand.SetDataBinding(dsCommand, "Table")
As you can suspect, dsCommand is a DataSet and DataGridCommand is the DataGrid to update.
Easy to date… OK.
Question:
---------
I want to have control on the background and foreground color of a cell based on some information like any people in this forum. I found many EXAMPLES with DataGridColumnStyle where the idea is to override the Paint method (aka: make a custom datagrid control). Yes, Perfect. I understand it BUT in this case… I DON’T CONTROL ANY COLUMN in the datagrid. It seems that the SetDataBinding() does everything by itself, it is magic.
I did not find HOW to OVERRIDE the Paint() method of this datagrid. Maybe I don’t understand something !
Danny Gilbert, enginneer
Montréal, Canada
-- modified at 13:44 Wednesday 19th April, 2006
|
|
|
|
|
Newbie requiring help to something which is no doubt very simple!
I have written a small application which gathers Company Name data from an Access table. I've also got a ValueMember set up which I am using to display the path to the mdb file used for the Company so that the user can see where the data is located, and it is also allowing me to offer the user a button so that they can open an Explorer window to go straight to the location of the file.
My problem is that if the Company Name field is blank, I want to display some text (other than a blank) in the list box.
The code snippet so far is:
*********************************************
strConnString = "Jet OLEDB:Database Password .... blah, blah ... Provider=""Microsoft.Jet.OLEDB.4.0"";"
Me.OleDbConnection1.ConnectionString = strConnString
Me.OleDbSelectCommand1.CommandText = "SELECT CompanyId, CompanyName, FilePath FROM CompanyDetails WHERE (Version = '1') AND (Deleted = 0) ORDER BY CompanyName"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
OleDbDataAdapter1.Fill(DsCentralDat1)
*********************************************
This works well, and I can see the contents of my database in the listbox - its just that I can't get it to overwrite any blank entries in the listbox (if it finds any) with something which may be more meaningful to the user.
Hope you can help.
|
|
|
|
|
i am just guessing now but try something like this
<br />
if list1.additem = "" then<br />
(insert your code here)<br />
|
|
|
|
|
Thanks for that - but the listbox is, I think, already created and populated during the Fill process. What I'm struggling to do is get it to go and interogate the contents of dataset and build the listbox contents based on the condition that you've mentioned.
I've thought about passing the contents of the database to an array, checking the contents, and passing that to the listbox, but I don't know how to do it.
Any more thoughts?
|
|
|
|
|