|
This piece of code
string methodName = MethodBase.GetCurrentMethod().Name;
does the trick. MethodBase is in the System.Reflection namespace.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
How to check if object is NULL:
object Location;<br />
Location = Reader.GetValue(0);<br />
I need an assert that object is not null here.
thanks
|
|
|
|
|
george ivanov wrote:
I need an assert that object is not null here.
You mean, like:
Trace.Assert(Location != null, "Location is null.");
found in the System.Diagnostics namespace?
Marc
My website
Latest Articles:
Undo/Redo Buffer
Memento Design Pattern
|
|
|
|
|
|
how can i append this code to be able to export report to TXT file.
"ExportFormatType"
// Set the Export type, this can be:
// PDF, Excel, Word Doc, RTF Doc,
// HTML 3.2, HTML 4.0 or CrystalReport
but not txt ????
string exportFilePath = "c:\\Report1.txt";
// Create an instance of the untyped report object
ReportDocument oRpt = new ReportDocument();
// Load the report from disk
oRpt.Load(@"C:\Aloha\RPTFOH\Report_1.rpt");
// Set the options for saving the exported file to disk DiskFileDestinationOptions oDest = new DiskFileDestinationOptions();
oDest.DiskFileName = exportFilePath;
// Set the exporting information
ExportOptions oExport = oRpt.ExportOptions;
// Set the destination options
oExport.DestinationOptions = oDest;
// Set the location, this can be:
// DiskFile, ExchangeFolder, MicrosoftMail or NoDestination
oExport.ExportDestinationType = ExportDestinationType.DiskFile;
oExport.ExportFormatType = ExportFormatType.WordForWindows;
// Call the Export method to export the report
oRpt.Export();
|
|
|
|
|
Hi All
Export to excel data from ultrawebgrid rows, Each data row contain one worksheet in excel sheet like as
row1 data contain sheet1
row2 data contain sheet2
row3 data contain sheet3
this opertaion getting at a time on pressing one button.
we have pressing one button ultrawebgrid rows data to export excel sheet, In excel sheet each worksheet contain one grid row deatails, for example grid have 10 rows ,pressing any button, In excel sheet 10 worksheets will occure and each worksheet contain 1 row data of grid pls send me a solution for this example
|
|
|
|
|
Hi
I want to fetch Current ruuning Dial up connection and LAN connection into Listbox
I am able to populate into LAN connection in Listbox and i am not able to fetch dial up connection.
Second question is to get directory path of
Network and Dial-up Connections
Any clue for this
regards
sanjeev
|
|
|
|
|
I've implemented a custom UITypeEditor for a collection-based property (PropertyInfoCollection). In the GetEditStyle and EditValue methods, I check the type of the value passed (using ITypeDescriptorContext.PropertyDescriptor and value.GetType() in GetEditStyle and EditValue, respectively) and compare them against typeof( PropertyInfoCollection ) using Type.Equals to ensure that only the correct types are edited. Although the two sides of the comparison should be the same type (they do have the same names, versions, assemblies, public key tokens etc. but not the same hash codes...) the test for equality fails if I close the solution, reopen it and try to edit the property. Forcibly casting the property value in EditValue from object to PropertyInfoCollection also results in an InvalidCastException. The test succeeds again (and the cast works) if I rebuild the solution.
Should I be checking types differently? The different hash codes reported for (ostensibly) the same type suggest that the type is perhaps getting loaded twice, and the two different Type instances are not equated. Is this even possible?
|
|
|
|
|
Since this is a UITypeEditor related question i guess you are doing some sort of vs.net designtime support?
if so , have in mind that when you recompile , vs.net does not always (never?) unload the previously version of your assemblies.
I had a very similair problem when dealing with a designtime collectioneditor that cached types.
After a few recompiles , there was equally many different versions of the same classes in mem at the same time.. very annoying..
so maybe you can try to get the assembly from the type and check if the assemblys hashcodes differ aswell and maybe check verion numbers.
To make things a bit worse , I also never found a solution for this
//Roger
|
|
|
|
|
Hi Roger
Thanks for the response - you got it in one. A little reflection quickly established that the respective assemblies have different codebases Hopefully this won't be a problem when the component is being used, as it shouldn't be getting rebuilt under those circumstances...
shambulator
|
|
|
|
|
When I xml serialize a file, I want all the empty node should not appear. e.g.
Please ignore the format of the sample xml serialized file.
The below mentioned xml serialized file has empty region node.
[Application]
[Name]abc[/Name]
[Region/]
[/Application]
I want empty node should not appear in xml serialized file.
[Application]
[Name]abc[/Name]
[/Application]
I appreciate, if anyone has any solutions or suggestions to this, please share their knowledge.
Regards,
Shiby
|
|
|
|
|
Hi,
I want my app to make logfile(a textfile) that doesnt grows bigger than 100kb.
Is there anyway I can delete the first 6 entries (without 6 blank lines) of a textfile and add a new entry without reading the entire file in memory.
|
|
|
|
|
Nope. If you want to remove data from the beginning of a text file, you have to rewrite the entire text file, skipping the data at the beginning you want to drop.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
I am writting C# Application.
I want to disable ALT+F4 closing in windows Form?
regards,
pubudu.
|
|
|
|
|
Hi!
Alt+F4 results in your form firing a Form.Closing event.
You can cancel the closing progress there.
Regards,
mav
|
|
|
|
|
Catch the event handler Form_Closing and :
void MyForm_Closing(ClosingEvent e)
{
e.Cancel;
}
|
|
|
|
|
hi all,
I have a database in SQL server 2000. There are 5 tables with data..
Now I want to get SQL Script for Tables with DATA in the Tables..
How can I succeed this?
Whenever I run that SQL Script ,I want to attach the database with data.
thanks in advance..
|
|
|
|
|
|
hi,
No.. not that what I want..
Suppose that I have table with 70 rows data..Now How can I generate SQL Script for create Table with 70 rows data in a another database?
regards,
pubudu.
|
|
|
|
|
just select out all of the values from the first table, go through them row by row and add them to a query, then just write the generated sql to a file from your application.
select * from table_1;
in your code then begin a String query = "create table_2....;"
then for each record returned in your query add it to query like so
query+= "insert into table_2 values (" + value(s) from query + ....");"
Does this help? or am I missing what you are trying to do?
Brian Van Beek
My Blog is Awesome, ok maybe not, but is still fun!!
|
|
|
|
|
Hello guys...I have a problem in here...(Who doesn't??;))
How can we connect crystal report to database manually not via database expert??
Thanks before..
Best regards
|
|
|
|
|
hi,
1) You have to create Data Set using "Data Set" in the add New Item Dialog.
2) Add Teables what do you need to generate report.
3)after that you can add that data set to your crystal report using database expert-->project data-->Ado.NET datasets..
4)complete database expert wizard.
3) then write like code to generate report :
Dataset1 ds2=new Dataset1();--->This is instance of Dataset1 class.
System.Data.SqlClient.SqlDataAdapter oda=create adapter instance using ur Query..
oda.Fill(ds2,tablename); (Give tablename=Table name in the query)
Now use this dataset object (ds2) to fill report..
regards,
pubudu.
|
|
|
|
|
hi pubudu..
I knew those way..At ur step 3,u still use database expert to connect to database..and u still use dataset.What i want to know is how we can view data from blank field in crystal report and we can set that source data in code behind..of coz..we need to know how to connect the database too..
Dont use .net facility for this..just coding..How that can be done?
The main problem is how can we view our report properly when we want to change the server..
Thanks again..
|
|
|
|
|
Hello,
The below article might help you. Is this you want?
http://support.businessobjects.com/library/kbase/articles/c2010371.asp
|
|
|
|
|
I can't seem to find and use the Image.FromFile method.
MSDN states that there is this function available and I have already included: using System.Drawing
Can anyone help me please?
|
|
|
|