|
hi samtam
i was also interested in this
by seeing some command line arguments of csc u can little understand since there are arguments for adding things like resourses files amd modules
even i didnt go for that since it involes lot of issues but sure go for that
and tell me latter
ok
shan
|
|
|
|
|
What is the best way of adding controls to the form in vb.net or c#.net
Phanindra...
|
|
|
|
|
If you are using Visual Studio, Borland's IDE, SharpDevelop or something of that kind, you can simply drag&drop the control on the form.
If you do not use a IDE you must define and initialize every control manaully from the code.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I have tried to put my C# applications and DLLs developed with VS.2005, including some C# DLLs that wrap legacy C++ DLLs (via Managed C++), on a computer that has no development environment. I thought if that computer had .NET 2.0 (and I am using some .NET 2.0-only components), my applications would run. They do not. They run fine on my development machine, but when I run the exact same executables on the exact same USB drive on another machine, they either fail to load (FileNotFoundException, but of course it doesn't tell you what file was not found), or they load but fail to work (unable to create TCPListener socket). Since there is no difference in the bits or in the directory, that leaves the path, as far as I can think. But apart from the VS.2005 development directories, the only path differences are to windows or winnt's system32 directory.
So what does one need on a Windows 2000 or XP machine, both of which have ALL service packs and updates and both of which have just had .NET 2.0 installed on them, to get programs to run properly? Any help would be greatly appreciated.
I have NOT made a deployment project of any kind and don't see why I should have to. I have just move the bits, including all dependencies from one machine to another.
|
|
|
|
|
BambooMoon wrote: I have NOT made a deployment project of any kind and don't see why I should have to.
COM registration would be one requirement. If your C++ .DLL's are COM-based, your Managed code wrappers wont work for what's not registered.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the good idea. Unfortunately, mine aren't COM based. But I've discovered that at least part of my problem is the C++ runtime used by the wrapped classes. I need to get vcredist_x86.exe from Microsoft and install it. That got things running completely on one of the four machines where they weren't working. The other 3 still don't work. But I've opened a support incident with Microsoft, so perhaps on Monday I'll know why.
|
|
|
|
|
Hello friends,
I have the following piece of code to call a stored procedure in SQL database:
Database db = DatabaseFactory.CreateDatabase(_DatabaseInstanceName);
DBCommandWrapper cmdWrapper = db.GetStoredProcCommandWrapper(spName);
cmdWrapper.AddInParameter("c_WksID", DbType.Int32, c_WksID);
....
In line 1 where I call the DatabaseFactory, I am not getting a good connection string to my database. If I interrogate db, in the watch window, I see that Connection String has an "error: Cannot obtain value" against it.
I have lot of stored procedures wrapper in my code and everything works except this.
Can someone please please help me?
Thanks.
-arvind
|
|
|
|
|
Does the line DatabaseFactory.CreateDatabase(_DatabaseInstanceName) work elsewhere in your code? If not, is the connection string set up properly in your config file? If so, is your code able to access the config file?
|
|
|
|
|
I've been putting together a simple routine to parse a streamreader, using a StringBuilder object as a buffer.
<br />
Dim streamBuffer(bufferSize) As Char<br />
Dim strBldr As New StringBuilder((bufferSize * 2) + 2)<br />
Dim reader As StreamReader<br />
<br />
Do<br />
If strBldr.Length < bufferSize Then <br />
Array.Clear(streamBuffer, 0, streamBuffer.Length)<br />
streamReadLength = reader.Read(streamBuffer, 0, bufferSize)<br />
<br />
strBldr.Append(streamBuffer)<br />
<br />
End If <br />
.<br />
.<br />
.<br />
What seems really weird is that only some passes through the loop the StringBuilder object's Length is incremented by the size of the streamBuffer's contents but the contents are not Appended to the StringBuilder.
So, while the strBldr.Length will equal say 4096, the StrBldr.ToString().Length will equal 310 and StrBldr.ToString() will produce a string that is 310 characters in length. Meanwhile, the streamBuffer field will have an array of characters in it.
I've searched unsuccessfully for any reports of bugs. Anyone got any ideas?
Will
|
|
|
|
|
I am getting into printing with VB.NET 2005 and want to implement the usual
capability that a user can select a selection of pages. I have a report
that is generated by my application that if the user wants all pages will
produce 3 pages. I want to offer the user the ability to select via the
print dialog that only pages 1 and 2 of it are printed or possibly pages 1
and 3 but not 2.
At the moment I can produce all three pages either as a print without a
preview, or via a print preview.
I have printing routine that handles the PrintPage event of the document
object used for this report.
My issue is how do I work out when the print handler routine is called which
of the pages is being printed at the time, ideally I want to have a select
case statement in my printing routine that says:
Select Case MyDoc.PrinterSettings.PrintRange.PageNumber
Case 1
'Printing commands for page 1
Case 2
'Printing commands for page 2
Case 2
'Printing commands for page 3
End Select
I feel like I am missing something and am probably making this more complicated than it is?
Any help, or links to web sources that describe the process would be
appreciated. I have 3 books on programming in VB.NET and none of them cover
the subject of how you deal with printing a selection of pages. I also
cannot find anything by googling that deals with this issue.
Siv
Siv
Graham Sivill
Martley, Near Worcester. UK.
|
|
|
|
|
hi
i am a novice to .net . i installed the frameword on my system.but forgot to install to iis server. Now i am not able to niether make web applications nor run it.
some one told that i've to map iis with framework.How do i do this.
can't i run iis on some other port?
please help me.and thanx in advance.
bye
nauty
|
|
|
|
|
I've had similar problems, you might just need to register the framework with IIS. This will tell IIS how to process .aspx files and such.
%WindowsDir%\Microsoft.NET\Framework\[Version]\aspnet_regiis.exe -i
|
|
|
|
|
|
Hi buddies
Thanx for your help.I really tried both the method but none of them worked.
Still when i am creating new project in asp.net, the following mess is displayed:
"Visual Studio.NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web Application or services."
When i am sending request to localhost at xplorer
http://localhost/
it is not opening the two screens of iis.but instead its opening someother page.
Can i change the port of iis.If so how can i do that.
thanx in advance again
bye
nauty
|
|
|
|
|
Hello,
I am new to this site and new to programming. I am stuck. My assignment states the following: We need to write a program that will read in a string of any length and then display the reverse of the original string, the original string in all Caps and in all Lowercase letters. When reversing the string, the letters should be reversed with the appropriate capitalization applied to all letters.
Sample output.
What string would you like to convert? John Smith
Reversed String: htimS nhoJ
All Uppercase: JOHN SMITH
All Lowercase: john smith
I figured out Uppercase and Lowercase but not reverse or even how to tie it in to the rest. We are using the console applications in Microsoft Visual Studio .NET 2003. Any Help would be greatly appreciated. Thank You!
__________________
This is hurting my Head !
Shadow Sprite
|
|
|
|
|
It's not really good form to ask for help on homework assignments.
Look into converting the string to a character array then reading the characters one at a time. I don't believe there is a String.Reverse() or anything like that.
|
|
|
|
|
This is a very simple assignment, so any code sample will give away the entire assignment! All the stuff you need has already been covered in the class.
Define a variable to hold a string
Get a string from the user (Console.ReadLine())
Output the string reversed (Console.WriteLine and StrReverse())
Output that string in Uppercase (string.ToUpper())
Output that string in Lowercase (string.ToLower())
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: Output the string reversed (Console.WriteLine and StrReverse())
StrReverse() is a VB6 function, not a .net String method. The Array and ArrayList classes have Reverse() methods, or it could be done manually with a for loop.
|
|
|
|
|
dan neely wrote: or it could be done manually with a for loop.
Yes, it could.
I looked at the overall complexity of the assignement (pretty much Programming 101 stuff) and took a guess at the language the class was in. Then, what are the simplest methods you could use to the job and would be likely covered in the class. StrReverse came to mind...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank You for your help. We just started this class a week ago out instructor believes in us just figuring it out......Then we go over how to solve the problem. Thanks Again.
Shadow Sprite
|
|
|
|
|
I know makecert.exe can create certificate file for me , but how can I create a certificate file through programming?
Thanks in advance!
|
|
|
|
|
Hi,
From an architectural perspective is it best to use the DatabaseFactory.CreateDatabase() method once at the top of a method call stack, and pass its reference to each method in the stack that needs database access, or should each method in the data-layer use the DatabaseFactory.CreateDatabase() method internally. Clearly the first approach uses less resources, as quite a lot of code is utilised by the DatabaseFactory.CreateDatabase() method, including reading the web.config file, however the second approach keeps the Data Layer tightly cohesive and loosely coupled from other sections.
For example let’s examine a web service solution. Assuming that the service document has a web method, which in-turn calls a business facade. The facade then forwards necessary information to one or more 'information managers'. These then utilise 'data managers' which provide scalar values, Datasets etc required for their calculations. Should each method in the data managers use DatabaseFactory.CreateDatabase() to get a connection to the DB for executing various commands, or should this be called once at the business facade level and a reference passed to each Info manager which in-turn pass to respective data managers?
Could anyone make a recommendation based on experience?
Thanks in advance.
|
|
|
|
|
First, you can use the Application State or the Caching Application Block to avoid going back to the Web.config file repeatedly.
Depends somewhat on whether you're doing WinForms or ASP.Net. Since you're talking about Web.config, it's obviously the latter. If you have a long chain of user controls as I do, you sure don't want every one of them creating and destroying their own database objects. I think Microsofts intention was pretty obvious when they modeled the database objects on the toolbar as something that you'd drag onto your page. Connections aren't cheap and your database server probably has a limit on the number of concurrent connections permitted so you don't want any more open at one time then necessary. Also, you stand a really good chance of deadlocking against yourself.
Will
|
|
|
|
|
Thanks for the reply Will,
The application in question is a web services project that returns data to both an ASP.NET and Windows Forms App so your recommendation won't really apply. At first I tried dragging and dropping connections and data adapters etc onto my web services file but I found the code generated to be very untidy. I instead opted to have my web service class contact a business facade, which then contacts other classes in a business layer, which finally contact a database layer where I have utilised the DAAB.
So to further define my question; do I create the Database object in the global.asax session start method, and then use the reference in each class required in the data layer? Do I create the connection each time a service is requested and pass it down to each class required in the data layer? Or do I just use the DatabaseFactory.CreateDatabase() method when it is required within each method of my data layer classes? I notice that when using a Database object supplied by the DAAB that you do not specify the connection string when you use a method such as 'ExecuteNonQuery', this suggest to me that the connection can be managed at this lower level.
|
|
|
|
|
First, you'd probably have better luck with this question in Web Development.
.
I haven't done any Web Services so I don't know the environment. However in general, if you know you're going to need the connection for five calls to the database, it's a lot cheaper if you don't build and destroy the database objects and connect and disconnect five times (although I don't have a good feel for what connection pooling buys). On the other hand, if you have any sort of volume then you don't want to tie up the database resources a moment longer than necessary. So, if a Session lasts until it times out for a Web Service(?), I wouldn't allocate the connection at the Session level.
Will
|
|
|
|