Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

bemahesh

@bemahesh
About
Posts
47
Topics
26
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Disassembly cannot be displayed. The expression has not yet been translated to native machine code.
    B bemahesh

    Hi, When I am executing the .net web applicaiton I get this error randomly. I mostly get it first time I start the application buy hitting F5. It ususally works second time. However, the execution might throw the same error when running the application second time as well. FYI:I have C# web application I see following message on the .net solution: Disassembly cannot be displayed. The expression has not yet been translated to native machine code. On the page side, I see Internet Explorer cannot display the webpage This problem can be caused by a variety of issues, including: •Internet connectivity has been lost. •The website is temporarily unavailable. •The Domain Name Server (DNS) is not reachable. •The Domain Name Server (DNS) does not have a listing for the website's domain. •There might be a typing error in the address. •If this is an HTTPS (secure) address, click Tools, click Internet Options, click Advanced, and check to be sure the SSL and TLS protocols are enabled under the security section.

    Thanks Needy

    C# security csharp help c++ sysadmin

  • DataTable.Select("Column is null") very slow
    B bemahesh

    If I was not clear enough, the problem is when i am trying to select the data from datatable using datatable.select(). If i have null value in one of the column in datatable and i am selecting from the datatable like: datatable.select("col4 is null"). That is where it takes longer time. Please, look at my original post this line is not creating overhead: if (col4 == "") // if column4 is null then use this But, this line does: dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " And col3 = " + "'" + col3+ "'" + " And col4 is null");

    Thanks Needy

    C# performance help

  • DataTable.Select("Column is null") very slow
    B bemahesh

    I already tried that. If you read my post I have that select line already in my code. I want to find out a work around. I replaced all nulls to the empty strings. However, this approach may not work if a column i am looking for is not string. As a result, if someone knows a better way or other way to select if values are null in datatable.

    Thanks Needy

    C# performance help

  • DataTable.Select("Column is null") very slow
    B bemahesh

    Hi I came across this problem while working on a loop which selects from a datatable. I am selecting from a datatable which has about 31K records. I am checking to see if a column value is null. If I am not selecting based on COLUMN IS NULL, then datatable.Select method works nice. However, if I look for null column values, the speed decreases substantially(i.e from seconds to about 30 to 40 minutes). I found a work around by replacing all null values with empty strings which solved the problem. However, if datatable column type was something other than string then this solution would not work. I was wondering if someone has an idea about this. Here is the sample of my code: I have replaced the dt datatable col4 values with empty strings for now(for better performance. I want to find a better way of doing select). As a result, the code looks like this. foreach (DataRow dr in dt.Rows)//31K records { col1 = dr["col1"].ToString().Trim(); col2 = dr["col2"].ToString().Trim(); col3 = dr["col3"].ToString().Trim(); col4 = dr ["col4"].ToString().Trim(); if (col4 == "") // if column4 is null then use this { recordsSelected = dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " And col3 = " + "'" + col3+ "'" + " And col4 = ''"); //recordsSelected = dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " And col3 = " + "'" + col3+ "'" + " And col4 is null"); <--very slow due to col4 is null } else { recordsSelected = dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " col3 = " + "'" + col3 + "'" + " And col4 = " + "'" + col4 + "'"); } }

    Thanks Needy

    C# performance help

  • Crystal report dynamically load an image on report document
    B bemahesh

    Hi I have a crystal report invoicing application that generates invoices. i have a logo on that invoice. I wanted to change the image based on if some condition met on code behind. Can anyone please shed some light on how to do this. This is what i am doing currently. private void CreateImageDataTableAndWriteSchema() { this.DsImages = new DataSet(); DataTable ImageTable = new DataTable("Images"); ImageTable.Columns.Add(new DataColumn("path", typeof(string))); ImageTable.Columns.Add(new DataColumn("image", typeof(System.Byte[]))); this.DsImages.Tables.Add(ImageTable); //this.DsImages.WriteXmlSchema(@"c:\myinvoices\ImagesSchema.xsd"); } as you can see from commented code that, I am creating an xsd dataset and I have added that dataset to the database fields. Then i have place image field from that table on to the report document. Then below i am loading an image file in that dataset/datatable. then i am loading image in to the dataset created above private void LoadLogoImage() { FileStream FilStr = new FileStream("C:\\mystuff\\Images\\my_logo.jpg", FileMode.Open); BinaryReader BinRed = new BinaryReader(FilStr); DataRow dr = this.DsImages.Tables["Images"].NewRow(); dr["path"] = "C:\\mystuff\\Images\\my_logo.jpg"; dr["image"] = BinRed.ReadBytes((int)BinRed.BaseStream.Length); this.DsImages.Tables["Images"].Rows.Add(dr); FilStr.Close(); BinRed.Close(); } Lastly, i am setting the datasource of the report document as following reportDocument.Subreports[SummaryDocument].Database.Tables["Images"].SetDataSource(DsImages.Tables["Images"]); I get error, invalid index when i try to execute this line. As stated above, i am trying to set the Images table datasource to the dataset we just poppulated with image path and byte data. fyi: i have a master report which holds 8 subreport. The SummaryDocument listed above is one of those subreport.

    Thanks Needy

    C# database help tutorial

  • CallbackOnCollectedDelegate was detected
    B bemahesh

    Well, I am not manipulating/adding/removing any delegates in my code. It is Crystal Report that is somehow removing (may be) the reference to the delegate. I have been trying to solve this issue for a couple of days but no luck yet. I will post my partial code tomorrow morning first thing. Looks like you are suggesting that I am declaring the event handle in which case I am not and it is CR that is I guess collecting this delegate before execution completes or may be not being properly handled. Please provide some kind of guidance

    Thanks Needy

    C# help csharp

  • CallbackOnCollectedDelegate was detected
    B bemahesh

    This did not help, I am still getting the error: CallbackOnCollectedDelegate was detected Message: A callback was made on a garbage collected delegate of type 'CrystalDecisions.ReportAppServer.DataSetConversion!CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter+CrdbAdoPlusDelegate::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called.

    Thanks Needy

    C# help csharp

  • CallbackOnCollectedDelegate was detected
    B bemahesh

    If I do this, do I need to put the 1000 milisecond detail between two report processing? And, would it release the resources or just give it some time to process the events? The reason why I am questoning this approach is that, i am looping through list of records and checking if data exists. Before doing this, i am setting loading report document in to the variable i have already decalred and using it. So if data doesn't exist for perticular id then I am immediately skipping that perticular record and get the next record from the datatable and try to process that record (and once again, I will load the report document in to the report document object I was using before). Also, If I recreate the report object by doc = new doc() when I am looping through it takes a lot of time to process the whole list. Is there another way where I can use the same doc and still not get the error. Like declare ReportDocument doc = new ReportDocument() as global variable within class then use this doc in the methods but keep loading different docs in to this same object so we can do away with reinitializing the reportdocument object and processing would be faster. Also, problem with creating a new report object is that, crystal report has limitation of number of new object set to 75 (named PrintJob limit which is registry entry item). I tried changing the limit to 1000 to 10000 and still didn't help so then I tried instantiating report object only one during whole process and just loading a different document everytime I need a new report to be generated. Please elaborate. -- modified at 16:38 Monday 16th April, 2007

    Thanks Needy

    C# help csharp

  • CallbackOnCollectedDelegate was detected
    B bemahesh

    hi, I am getting this error when generating pdf docs from crystal report app (C# 2.0). CallbackOnCollectedDelegate was detected Message: A callback was made on a garbage collected delegate of type 'CrystalDecisions.ReportAppServer.DataSetConversion!CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter+CrdbAdoPlusDelegate::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called. I am creating pdf docs from crystal report app which is being hosted in console app. I have a report document with 6 sub reports. I am poppulating these sub reports on the report document by pushing a datatable/dataset. In doing that, I am instantiating report document once as a global variable. Then each next pdf doc will be using that same report document object but I am loading a new report doc every time new report(pdf doc) needs to be generated. After about 20 to 30 docs are generated I get error listed on top "CallbackOnCollectedDelegate was detected" with detail description also provided earlier. Reading this error made me think that if I put some kind of delay (1000 miliseconds) before loading report, it would help but did not solve my problem. It did went further than 20 to 30 docs to 104 docs but that error did come back. I would appreciate if some one can shed some light

    Thanks Needy

    C# help csharp

  • Crystal Reports Supress section C#
    B bemahesh

    Hi, I have a crystal Reports application in C# displays report with 6 sections. I want to have report display those sections only if there is any data to display. If there is no data to display, I want to supress the whole report section if possible. In addition, Is there any way to supress a line in Crystal report? Thank you in advance

    Thanks Needy

    C# csharp question

  • The requested URI is invalid for this FTP command
    B bemahesh

    Hi, I keep getting the error "The requested URI is invalid for this FTP command." when trying to upload a file from local machine to the FTP server using code below in C# 2.0. I am getting error on the bold line below. I would appreaciate if someone can guide me to proper solution. thanks Mahesh public void Deliver() { FtpWebRequest request = (FtpWebRequest)WebRequest.Create(destinationHost); //destination host is ftp://actual IP address/ request.Method = WebRequestMethods.Ftp.UploadFile; request.Credentials = new NetworkCredential(userId, password); // Copy the contents of the file to the request stream. StreamReader sourceStream = new StreamReader(sourceDirectory + sourceFile); byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd()); sourceStream.Close(); request.ContentLength = fileContents.Length; Stream requestStream = request.GetRequestStream(); //getting error here stating requested uri is invalid for this FTP commnand. requestStream.Write(fileContents, 0, fileContents.Length); requestStream.Close(); FtpWebResponse response = (FtpWebResponse)request.GetResponse(); Console.WriteLine("Upload File Complete, status {0}", response.StatusDescription); response.Close(); }

    Thanks Needy

    C# csharp sysadmin help tutorial

  • DataTableReader is invalid for current DataTable
    B bemahesh

    hi, I am trying to get the data from datatable in to DataTableReader so i can read the data like datareader. I am getting error "DataTableReader is invalid for current DataTable" when trying to call the GetValues method on DataTableReader. Please shed some light. If it helps here is my code in C# 2.0 public void Execute() { using (DataTableReader dataTableReader = new DataTableReader(myDataTable)) { object[] values = new object[dataTableReader.FieldCount]; int fieldCount = dataTableReader.GetValues(values); string id= values[4].ToString(); string Type = values[0].ToString(); } } i am poppulating a datatable from SQL 2000 database and is getting 4 rows back ( i can see that in datatable viewer in debug mode). I am also able to get the field count on datatableReader which is 6 (=number of columns). However, when i get to the point where i need to get the values from the dataTableReader using dataTableReader.GetValues(values), that's where it breaks up and states "DataTableReader is invalid for current DataTable" Please shed some light

    Thanks Needy

    C# database csharp debugging help

  • Display image from SQL DB on to Picturebox In Windows Forms App
    B bemahesh

    Hi, I am trying to display an image from the sql 2000 database on to the picture box control on windows app (VS 2.0). I am able to pull the image in to byte array. I also am able to put the byte array in to the Memory stream by writing it like stream.Write(image, 0, image.Length) However, when i try to create a bitmap out of the memory stream it thorows an exception stating "parameter is not valid". The second approach I tried was to use Image.FromStream(ms1) method, but it also says "parameter is not valid" when it tries to get the image from stream (memory stream). The third approach i tried was writing to a temporary file stream and then read from file using Image.FromFile(strfn, true). This line gets an error stating "Out of memory". Nothing seems to be working. Please shed some light if possible. All i want to do is display an image from sql db field(image field) on to picture box in windows application using C# 2.0 Please look at the code below for detail. The line in bold where I am getting my exceptions. // Put user code to initialize the page here MemoryStream stream = new MemoryStream(); SqlConnection connection = new SqlConnection(@"my connection string"); try { connection.Open(); SqlCommand command = new SqlCommand("select image from images Where EntryDate > '2/15/2007'", connection); byte[] image = (byte[])command.ExecuteScalar(); stream.Write(image, 0, image.Length); Bitmap bitmap = new Bitmap(stream); /////testing 2 MemoryStream ms1 = new MemoryStream(image); exceptionPictureBox.Image = Image.FromStream(ms1); ///testing 3 string strfn = Convert.ToString(DateTime.Now.ToFileTime()); FileStream fs = new FileStream(strfn, FileMode.CreateNew, FileAccess.Write); fs.Write(image, 0, image.Length); fs.Flush(); fs.Close(); exceptionPictureBox.Image = Image.FromFile(strfn, true); /////testing 3 } finally { connection.Close(); stream.Close(); }

    Thanks Needy

    C# database csharp visual-studio winforms graphics

  • DatagridView Cell datatype validation on edit
    B bemahesh

    Thank you Lisa. I will post if any problem occurs. I appreciate your help.

    Thanks Needy

    C# csharp

  • DatagridView Cell datatype validation on edit
    B bemahesh

    hi, I have a datagridview on windows app(.net 2.0). I wanted to provide user with flexibility of changing any cell values within datagridView. In doing so, i wanted to check if datatype of the cell gets validated. When user updates the value within the datagridView, I want to check the OLD DATATYPE and NEW DATATYPE of the data. Meaning, I want to know beforehand what datatype the column allows and what datatype is the text user typing in. I tried this: object gridCellValue; void repriceQuedataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e) { gridCellValue = repriceQuedataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; } void repriceQuedataGridView1_CellParsing(object sender, DataGridViewCellParsingEventArgs e) { Type sourceType = e.ColumnIndex.GetType(); Type changedDataType = e.Value.GetType(); Console.WriteLine(sender.GetType().ToString()); if (!sourceType.Equals(changedDataType)) { MessageBox.Show("Please try again. Expected type is: " + e.ColumnIndex.GetType().ToString()); e.Value = gridCellValue; e.ParsingApplied = true; } } However, Type changedDataType = e.Value.GetType(); line always gets datatype string because e.value is string. I want to check if lets say the original column allows int then the new value that user enters is of type int. I want to write these events in such a way that it is GENERIC FOR ANY DATATYPE. Please shed some light.

    Thanks Needy

    C# csharp

  • The transaction has already been implicitly or explicitly committed or aborted.
    B bemahesh

    well, I am not an expert at TransactionScope. I just started using it for first time ever using .net 2.0. I may not be able to answer your questions since it seems your knowledge in the area may be greater than me. However, I was googaling for exception message and found out that if these settings are checked but didn't mention No authentication Required. I tried checking the check boxes but couldn't get transaction scope to work. I was still getting the exception. At the end, I tried checking the No authentication requiered option (radio button). and, that worked (what i mean by working or GO AWAY is that when i try to open the connection it indeed opens the connection and doesn't throw the exception stating "the transaction.....blah blah blah". I tried executing the update statements and they indeed executed as expected. I may be ignorent or missing some important implications you may have suggested (in terms of security?). Please educate me further. I will be waiting for further input thanks a lot

    Thanks Needy

    C# csharp database help sql-server visual-studio

  • The transaction has already been implicitly or explicitly committed or aborted.
    B bemahesh

    I found the solution to the problem. go to Administrative tools Component Servers MyComputer (right click) go to properties MSDTC TAB Click on Security Configuration Button Make sure Network DTS Access, Allow Remote Access, Allow Inbound, Allow Outbound, Enable Transaction Internet Protocol (TIP) Transactions are CHECKED. Most important of all is No authentication Required option. This option should be selected otherwise even if all of the above check boxes are selected, the exception will not go away. Somehow error description is completely different than "NO Authentican Required" radio button. Anyway, I would wanted to post the solution so others can benefit.

    Thanks Needy

    C# csharp database help sql-server visual-studio

  • The transaction has already been implicitly or explicitly committed or aborted.
    B bemahesh

    Hi, I have been getting this error when trying to open a connection within transactionScope of .net 2.0. "The transaction has already been implicitly or explicitly committed or aborted." I have visual studio 2.0 Professional and am using C# for class library that I am working on. I get this error when trying to open the connection to SQL Server 2000. Any help would be greatly appreciated. if it helps here is my code. myID.GetNextID(); is the method where error occurs. I am opening a sql server connction and execute the stored procedure in this method. When i try to open the connection, that is where the error occurs "The transaction has already been implicitly or explicitly committed or aborted" public void Execute() { MyID myID = new MyID() DataTable myRecords = GetRecords(); foreach (DataRow dr in myRecords.Rows) { using (TransactionScope scope = new TransactionScope()) { int idint= myID.GetNextID(); string summaryUpdateQuery = "UPDATE tblSummarySample SET ID= " + idint+ " WHERE ServiceID= " + dr["mySampleID"].ToString(); UpdateSummaryRecord(summaryUpdateQuery); string detailUpdateQuery = "UPDATE tblDetailSample SET TransID = " + idint+ " WHERE ServiceID= " + dr["mySampleID"].ToString(); UpdateMyRecords(detailUpdateQuery); scope.Complete(); } } }

    Thanks Needy

    C# csharp database help sql-server visual-studio

  • XML Parsing and XPath [modified]
    B bemahesh

    Hi, I have a xml string that I have to parse. I am using xpath to parse this string. I can get to the part A1:ABCID="4567" but when I try to access A2:parentid="0123". It doens't let me. can some help me out with the syntax example? thanks XML string is: " " " " -- modified at 10:22 Tuesday 8th August, 2006 Thanks Needy

    XML / XSL xml json help tutorial question

  • VS.net Add Web reference
    B bemahesh

    https://transactions.imatts.com/transactions/signup/signup.asmx?WSDL is it internet options problem or some kind of project properties/options problem. I keep getting dialog box do you want to open a file or save it to the disk. If I open the file, it opens up xml file. I would really appreciate any help and thanks a lot for your response. Thanks Needy

    Visual Basic help csharp visual-studio question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups