|
no problem
I learned the hard way to check my sql string char by char (searched for the same thing a long long time a while back so...)
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
I have converted a vb6 application in vb.net 2005 express.
My application has lots of procedures and functions in modules.
As same procedures are used in various exe files i want o create a common procedure base
(presently same procedures are used in various exe files as modules)
Can I create a .class file or dll file and call the same in main project files.
This will reduce lot of common code
please suggest sample code as I have no formal education in vb.net,
No one gets before time and more then destiny
|
|
|
|
|
Yes , You can
Just create a class in with the same namespace and that class will contain all of your recquired function,
and from the main fuction just create the object and access your required function !!!!!
Good luck
Happy Programming
-----
Abhijit
|
|
|
|
|
I verify that with these following codes I should see the MS-DOS windows
<br />
Public Class Form1<br />
Sub Main()<br />
System.Console.WriteLine("About VB Example")<br />
System.Console.WriteLine()<br />
<br />
' Prompt user for identifier<br />
Dim ReplyString As String<br />
<br />
System.Console.Write("Type A or B: ")<br />
ReplyString = System.Console.ReadLine()<br />
System.Console.Write("You typed: " & ReplyString)<br />
End Sub<br />
End Class<br />
But after running debug without any error ... I saw nothing. Even if I use a button to activate similar codes ... the result is nothing!
By the way I do have .NET Framework SDK
Anyone can help?
|
|
|
|
|
It appears that you have created a windows form project as indicated by the Class called Form1. Try creating a Console app instead. This worked for me.
Module Module1
Sub Main()
System.Console.WriteLine("About VB Example")
System.Console.WriteLine()
' Prompt user for identifier
Dim ReplyString As String
System.Console.Write("Type A or B: ")
ReplyString = System.Console.ReadLine()
System.Console.Write("You typed: " & ReplyString)
End Sub
End Module
|
|
|
|
|
You are absolutely right!
Thank a lots
|
|
|
|
|
hi all,
i have a datagridview in my program which contain Combobox type column. My problem is that combo box column require two click to open drop down list.
anybody have idea that how can i open dropdown list on single click ?( as we do in normal combo box control)
thanks in advance
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
i am populating the datagridview from db. i am making changes to datagridview and also i am adding new row.
|
|
|
|
|
Please provide more information.
|
|
|
|
|
i am going to populate the datagridview. i want to make changes to datagridview and i want that changes to be available in database . i will insert new row in the datagridview , i want to add newly added row to database. i am using sqlcommand option . but i want to use sqlcommandbuilder but i am uanble to update using sqlcommandbuilder.
Siva.
|
|
|
|
|
I would say use the RowAdded Event to trigger a function that finds which row was just added, parse that information, build an appropriate update command, then use that to update your database
|
|
|
|
|
hi all
i want to Call an Exe, that is a Console Application, in that Exe i want throw in Commands from e.g like "Dir", but i want to do this in vb.NET.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You can use the Process class to achieve this.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
i have Googled it , and i will read about it thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Vuyiswamb wrote: i have Googled it , and i will read about it thanks
All you need is:
<br />
Process.Start("ConsoleAppName.exe")<br />
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Wow Thanks man
its So Easy.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
One more thing , how to i tell the Compiler the location of the File?, should i use the Path ? like
Process.Start("C:\ConsoleAppName.exe")
?
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
|
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hi all,
i m creating directory structure (mean which contain subdirectory & other files). Everything is working well except one thing. In 40% case i get error -Access to the Path "Some Path & "\*.txt" is denied.
Here one thing, that i want to explain is that on every run, i select same folder
any body have idea where i am wrong ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Are your permissions set right?
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
hi ponard,
i already specify that some time code works well but sometime not. Each time i select same path.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Can you please show the exact statement(s) that fail? and the exact error message?
are the difficult files freshly created by your app?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hi luc .following is the code that i use
Private Sub CreateTextFile(ByVal Filepath As String, ByVal data As String)<br />
Dim oFile As System.IO.File<br />
Dim oWrite As System.IO.StreamWriter<br />
Dim oRead As System.IO.StreamReader<br />
Dim PreviousData As String = ""<br />
Dim CheckHypen As String<br />
<br />
If File.Exists(Filepath) Then<br />
oRead = oFile.OpenText(Filepath)<br />
While oRead.Peek <> -1<br />
If PreviousData = "" Then<br />
PreviousData = oRead.ReadLine()<br />
Else<br />
CheckHypen = oRead.ReadLine<br />
If CheckHypen <> "-" Then ' if file already exist then remove hypen from file. Hypen is last character of File<br />
PreviousData = PreviousData & ControlChars.NewLine & CheckHypen<br />
End If<br />
End If<br />
End While<br />
oRead.Close()<br />
End If<br />
oWrite = oFile.CreateText(Filepath)<br />
<br />
If PreviousData = "" Then<br />
PreviousData = data<br />
oWrite.WriteLine(PreviousData)<br />
Else<br />
PreviousData = PreviousData & ControlChars.NewLine & data<br />
oWrite.WriteLine(PreviousData)<br />
End If<br />
oWrite.Close()<br />
oFile.Delete(Filepath)<br />
PreviousData = PreviousData & ControlChars.NewLine & "-"<br />
oFile.AppendAllText(Filepath, PreviousData, System.Text.Encoding.Unicode)<br />
End Sub<br />
have any idea where i am wrong ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
So I guess your app just created this/these file(s) and now wants to delete them?
This is my standard answer for renaming/deleting new files:
if you want write or delete access (anything other than read access) to a file
that just got created (by yourself or someone else, does not matter),
chances are you will find the file is being accessed by some other process,
and your access is not granted.
The other process very likely is some server code that is there to assist you
somehow. Candidates are:
- anti-virus software (Norton, McAfee, whatever)
- indexing software (Google Desktop, MS Office, whatever)
The common thing is these packages are looking all the time for new files, so
they can inspect them.
Microsoft is aware of the consequences; Windows Explorer will try rename and
delete attempts up to five times (with one-second interval), and only reports
failure if the action continues to fail for that time.
The solution:
1. either use a different file name
2. or remove all background reader candidates (bad idea)
3. or implement the retry loop as Explorer has it (use a Windows.Forms.Timer
for this)
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|