Thanks a lot !!
AnnnS
Posts
-
== String comparison [modified] -
== String comparison [modified]Hi All, I have a doubt. I was just trying out some basic things in Core Java. Here is the code public class Test { public static void main(String args[]) { String a = "Hai"; String b = "Hai"; if(a == b) { System.out.println("Equal"); } else { System.out.println("Not Equal"); } } } I Assumed that the result would be "Not Equal" as == does reference comparison. But I got the answer as "Equal". Then I tried the second code public class Test { public static void main(String args[]) { String a = "Hai"; a += ""; String b = "Hai"; if(a == b) { System.out.println("Equal"); } else { System.out.println("Not Equal"); } } } Now i could get "Not equal". But logically both codes are same. Why is this so?? Does Java share similar Objects?? Can anyone give an explanation on this?? Thanks, Annns...:confused:
modified on Thursday, February 11, 2010 8:38 AM
-
Query to access excel data....thanx so much .. let me try it out !!
-
Query to access excel data....thanx for the reply :).. hope it will help me... but still one more doubt:confused:... then how will we get the value from result set?? like rs.getString("?"); ??? Thnks Annns
-
Query to access excel data....hi all i am using odbc connection to query the data from excel ... i am able to ... the query i use is select empid from [sheet1$]... (empid is the column header in the first row) the problem is i want to access the data by ponting the index of the column .. something like select column1 from [sheet1$] can anyone suggest the query for that ??? Annns
-
Problem in Adding hyperlink to Excel 97Hi all i tried to add hyperlink in EXcel and it worked fine with office XP and 2000. but when i run the samein Office 97 with windows 98 OS the following exception comes ************** Exception Text ************** System.Reflection.TargetParameterCountException: Number of parameters specified does not match the expected number. at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) at Excel.Hyperlinks.Add(Object Anchor, String Address, Object SubAddress, Object ScreenTip, Object TextToDisplay) at DMPTEST.ReportGenerator.Timer1Tick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) The code which i used to add hyperlink is indexWorkSheet.Hyperlinks.Add(indexWorkSheet.Cells[intSlNoCount+8,4], "" ,"'Sheet 1'!A1" , "Click ", "textToDisplay" ); Plz help me out why is it not working with office 97
-
Detect inactive Bat fileHi all i have the folloeing code to run a batch file System.Diagnostics.ProcessStartInfo psiinfo=new System.Diagnostics.ProcessStartInfo("aaa.bat"); psiinfo.WindowStyle=System.Diagnostics.ProcessWindowStyle.Hidden; psiinfo.CreateNoWindow=true; System.Diagnostics.Process p1=System.Diagnostics.Process.Start(psiinfo); while(!p1.HasExited); // //Following some other code // It works fine with Xp and 2000. But the problem comes with windows 98 in that after executing the batch file the batch file will not get closed . instead it will become an inactive window and the user has to close it manualy . So "has Exited " is not working here since the process is not getting closed. is there any way to find out whether the process in inactive or completed execution .. thanks in Advance AnnS Suffering cheerfully endured, ceases to be suffering and is transmuted into an ineffable joy.
-
Image downloadinghi all i was trying to download some images using the following code. it was working perfectly before but recently it strted throwing an exception (webclient exception ) System.Net.WebClient wb=new System.Net.WebClient(); wb.DownloadFile(htmladdress,filepath); Can anyone suggest an idea to overcome?? is it due to some problem in my net connection?? Thanks
-
refreshing the printer folderhi all... i am trying to delete all the data in printer spooler here is my code ProcessStartInfo pns=new ProcessStartInfo("net","stop spooler"); System.Diagnostics.Process.Start(pns); string syspath=Environment.GetFolderPath(Environment.SpecialFolder.System); DirectoryInfo drdd= new System.IO.DirectoryInfo(syspath+"\\spool\\PRINTERS"); foreach(System.IO.FileInfo fin in drdd.GetFiles()) { fin.Delete(); } pns=new ProcessStartInfo("net","start spooler"); System.Diagnostics.Process.Start(pns); everything works fine .. but the problem is if we want to print again , then we have to manually go and refresh that printer folder(where the printers are listed ) how can i automate that .. thanx Akhil
-
Problem with excel 97Thats what i too want to know .. :D
-
Problem with excel 97hi... thanx for the response ... As u told i hav checked everything ... everything seem to be correct ... i hav added STAThread Attribute also ... My Concern is when i do the same operation in one pc with excel 2000 installed with Microsoft Excel 9.0 Object Library , it works fine ... but when i try it in another pc with Excel 97 installed with Microsoft Excel 8.0 Object Library reference , it gives the Above given exception ... for last one week i hav been struggling with this problem ... plz help .. Thanks Akhil
-
Problem with excel 97When i try to open the Workbook... ie Excel.Workbook wb= wbs.open("abc.xls",Type.missing .........) At this line error Occurs ... System.Runtime.InteropServices.COMException (0x8007F808): Exception from HRESULT: 0x8007F808 at Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru) this is the Error Message....
-
Problem with excel 97Hi all i am trying to automate MSEXcel.. i hav win2K as OS and Excel version is 97 i hav added the reference as Excel 8.0 ... Now when i try to open the Excel Work book, it gives out an exception (COMException).... but when i try the same caode in excel 2000 with Excel 9.0 as reference i am able to do ... i am using .netframework 2.0 ... is it not compatible with excel 97??? is there any way to solve this problem??? Thanks Akhil
-
Problem with excel 97Hi all i was coding from one pc which has Excel 2000 Installed and i was successful in interfacing with c# ... but when i try to run the same in another pc with Excel 97 , it fails . Gives a runtime error ... is it not compatible with 97? how can i ressolve this issue ?? Thanks Akhil :doh:
-
Interop.excel.. Exception in 2K, working in Xphi all my problem is when i try to open an excel workbook, it gives a runtime ComException in win2K where in XP its working fine Code is Excel.Workbook wb =wbs.Open("mtc.xls",false, Type.Missing, Type.Missing, Type.Missing, false, Type.Missing, Type.Missing,true, Type.Missing, Type.Missing, Type.Missing,Type.Missing); Can anyone suggest an idea??:confused: Thanks in Advance Akhil
-
Message Box start positionThanx For the reply But i dont really understand how do u relate messagebox and textbox...
-
Message Box start positionhi all My Doubt might be a simple one .... how can we display the message Box in the center of the parent window?? i am passing 'this' in the arguments ... still its displayed in the center of the screen , not in the center of the parent window ... Can anybody suggest an idea?? Akhil
-
creating hyperlink in Excel to the next WorksheetHi all can anybody help me how to create a hyperlink in one worksheet and it should link to another cell in another worksheet in same workbook ... i tried hyperlink.add method(interop.excel) .. but i am not getting the parameters correctly ... thanks in advance Akhil
-
interop.excelhI can anybody tell me how can i make a copy of one worksheet (excel) in the same work book .. i tried worksheets.copy method .. but it copies all the work sheets .. can any body suggest an idea??? Thanx Akhil
-
How to create a setup in C#?