|
No problem, easy mistake to make, done it myself but usually realise when running in debug and stepping through the code
sivakumar.mariappan wrote: how to add constraints with table columns through coding?
No idea, I don't use access, but I bet google can help
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi,
I am new in Dotnet. I read the excel upto used ranges and print the data to messagebox. But I got Each value one by one after click the ok button.
But i need display the total data at once.
My Code is:
dim exapp as excel.application
dim exwork as excel.workbook
dim exsheet as excel.worksheet
exapp = New Excel.ApplicationClass
exwork = exapp.Workbooks.Open(TextBox1.Text)
exsheet = exwork.Worksheets("sheet1")
range = exsheet.UsedRange
For rcount = 1 To range.Rows.Count
For ccount = 1 To range.Columns.Count
obj = CType(range.Cells(rcount, ccount), Excel.Range)
MsgBox(obj.value)
Next
Next
exwork.Close()
exapp.Quit()
MsgBox("complete")
TextBox1.Clear()
Example: (In Excel)
No Name Age
1 Gopi 26
2 raja 24
3 mani 29
Output:
No,Name,Age
1,Gopi,26
2,raja,24
3,mani,29
But I got Each value one by one. I need full ouput as once. Please help me.
By
Gopi A
|
|
|
|
|
Well, you put a messagebox inside of a loop inside of another loop.
In other words, you are looping through all the cells in the sheet, and showing a messagebox for the value of each cell.
Try to concatenate the values in the cells into a string (for example) somehow, and then (for testing purposes) place MsgBox(MyConcatenatedString) outside the outer loop.
My advice is free, and you may get what you paid for.
|
|
|
|
|
try
dim st as string 'or to stringbuilder
dim exapp as excel.application
dim exwork as excel.workbook
dim exsheet as excel.worksheet
exapp = New Excel.ApplicationClass
exwork = exapp.Workbooks.Open(TextBox1.Text)
exsheet = exwork.Worksheets("sheet1")
range = exsheet.UsedRange
For rcount = 1 To range.Rows.Count
For ccount = 1 To range.Columns.Count
obj = CType(range.Cells(rcount, ccount), Excel.Range)
st = st + convert.tostring(obj)
Next
Next
MsgBox(st)
exwork.Close()
exapp.Quit()
MsgBox("complete")
TextBox1.Clear()
|
|
|
|
|
Anyhow I succeeded the SMTP-Emails. But as anext step, when they use my program, I want to send from their emails a/c. Rightnow I know only my network user Name & Paswword & My-email a/c name etc..
So how to detect their [network] system user name [I can find], Password, Email a/c ....?
Any better ideas for me? All my network Clients are using Windows XP
Thanks Again....
modified on Wednesday, June 17, 2009 3:47 AM
|
|
|
|
|
For obvious reasons it is not possible to just retrieve passwords to anything, through .net, think about it.
So unless you are intending to build a spam bot, you will simply have to offer the user the possibility to enter email address and password somewhere, and build a secure storage for that password, so hackers won't be able to abuse your program to collect passwords.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hello,
How can you change the size of the MDI container in a MDI parent form?
|
|
|
|
|
The control is MdiClient. You just need to enumerate the Controls collection of the form, looking for a control of Type MdiClient. Then you need to turn off the Dock proeprty and set the position and size properties to whatever you need.
|
|
|
|
|
Is this the way you mean,but it's not working.When maximize the parent form,the child form maximizes to the entire form.What is the problem?
For Each ctrl As Control In Me.Controls
If TypeOf ctrl Is MdiClient Then
ctrl.Dock = DockStyle.None
ctrl.Location = New System.Drawing.Point(1, 107)
ctrl.Size = New System.Drawing.Size(769, 434)
End If
Next
|
|
|
|
|
That code works fine and as expected, though I'd probably add an Exit For before the End If .
If you're saying that the title bar for the child form takes up the entire width of the patent form, this is the expected behavior and you can't turn it off.
If you're saying that if you maximize the parent form and this causes the child form to maximize also, then something in your code is causing this. The code you posted will not do cause that problem to happen.
|
|
|
|
|
Hi,
I want to initiate a uninstall process of an application (already install) through another vb.net application.
Is it possible?
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
Yes. It can be done using the Process class.
जय हिंद
|
|
|
|
|
got it.
Thanks
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
Hi.
i have 2 applications. one developed in c# and other in vb 6. vb application makes some changes to sql database. These changes need to be recorded in another database(used by c# code). Due to privilages on the databases, i need vb to call the c# exe and provide it with 2 arguments. That is, my vb code needs to call a C# exe and provide it with two arguments. C# application is a console application. is this possible in vb. If yes, some help would be greatly appreciated.
Thanx in advance
mark
|
|
|
|
|
I am not at all sure that you can call into a managed .EXE from VB6.
However, if C-like exports between VB6 and VB.Net[^] is correct you can call into a managed .dll. If you are able to separate the parts of your application to be called into a dll and apply the principles from the article to it, that might be a resolution to your problem.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
thanx for replying.
I went through the article you forwarded, and realized that it requires editing in IL. I also read some comments and other articles and am confused whether i should take this approach or not?
If you can provide some more help, i would be really greatfull . Thanx
|
|
|
|
|
Hi,
you probably could organize the C# app as a console app taking its parameters from the command line; and invoke it the way VB6 invokes all EXE files, through some magic function (system? ShellExecute? I don't recall).
FWIW: if the parameters become more complex, I tend to have the master EXE put them in a file, and pass the full filepath (which would contain numeric date and time to make it unique) as the single parameter to the slave EXE.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hi,
Thanx for replying.
I have received a reply that points at the fact that "vb might not be able to call managed dll/exe". which is the case in .net. Do you still think that i should organize the C# application as console and invoke it using vb6 shell. Again, being a .net programmer, i would appreciate if u forward me a better link on system? ShellExecute? .
Thankyou again
|
|
|
|
|
|
.DLL:
do what Uncle said above to make the .dll support interop. Make sure you to use generic data types in your method signature. There are plenty of tutorials on this. Use regasm as nec on clients, etc.
.EXE:
You can start a .Net exe from VB6. For a simple example, all you have to do is something like:
strRunFilename = strRunFilename & " " & gstrCommandLineProgram
Shell strRunFilename, vbNormalFocus
Note that gstrCommandLineProgram get parsed from within the .Net .exe and the appropriate action(s) are taken. You could also use CreateProcessWithLogon, WaitForSingleObject, etc, etc depending on exactly what you need to do; but shell is easy and probably suffice for you what you're trying to do.
This is digging deep in the memory banks, but I think shell will work pretty much for any OS level where as CreateProcessWithLogon may have not worked with win98 (if there are OS requirements).
Cheers!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
OK, I am in the home stretch here, dynamic context menu over dynamic control arrays, for a guy new to .net. I have it all working except for one small, strange little thing. In my procedure to show the context menu, I thought I could just use the me.mouseposition. as follows:
Private Sub lblSlot_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click
HandlePopup(sender, e) ' build my menu
Debug.Write(Me.MousePosition())
ContextMenu1.Show(Me, Me.MousePosition)
Debug.Write(Me.MousePosition())
End Sub
if I look at the output in the debug window pre and post clicking the mouse and seeing the popup, I will see something like the following: The menu does not pop up near where the mouse was.
{x=786, Y=476}{x=797, Y=687}
any idea what may be going on here?
No-e
|
|
|
|
|
Take a look at the following two properties PointToClient PointToScreen
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
What is the .Net equiv to this vb6 format:
Format(strCode, "@@-@@@@-@@")
Apparently my brain has stopped functioning today. Sigh.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
String.Format
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|