.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

e.PageSettings values take too long to read.

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :Windows Application
 
I have an application that takes a long time to view the Print Preview on a particular user's computer.  The rest of my users don't have a problem.  I narrowed the problem down to the following line of code: Dim XOffset As Single = CSng((e.PageSettings.PaperSize.Width - e.PageSettings.Margins.Right - e.PageSettings.Margins.Left) / 2 - StringSize.Width / 2) which simply determines an X offset for a subsequent e.Drawstring that is centered. On this particular user's computer, this line of code takes between 1 and 2 seconds to execute. Another strange symptom is that once he prints the document, the print preview executes as fast as it should. Can anyone shed some light on this mysterious behavior?  Thanks!


View Complete Post


More Related Resource Links

How to Read values from the XAML file at Runtime

  
Hi , I am creating a BuildDefinition from code and Loading the Build Process template. Now,I want to read and Validate the Build Process template parameter values.When I am debuggig,I could see that these are in Xaml format. Ex: I have some value "BuildType" as "Daily" in xaml file.I want to read these values and validate them I dont know what is the bestway to read the values.Can any one please let me know how can we do it. Thanks, Srikrishna              

How to read checkbox values from programmatically created checkboxes?

  

I have a form that does a loop to create checkboxes.  Here is the code in the loop:

LeftPosition+=120;
cbxDrives.Top = TopPosition;
cbxDrives.Left = LeftPosition;
cbxDrives.Text = d.Name; 
CheckBox cbxDrives = new CheckBox();this.Controls.Add(cbxDrives);

This creates multiple check boxes on the form, and this works fine.

However, in the code behind for my button that the user clicks to execute the form, I cannot figure how how to read the values for the checkboxes.  I've tried:

foreach (CheckBox cbxDrive in cbxDrives)
{
}

b

How to read control id and values from pdf file

  

Hi

 I have requirement like admin will uploads some pdf files ,which contain text box ,check box ...,

similarly we will have master table which contain some matched fields.

If pdf fields mached with master table fields then i will store mached fields pdf control id's in data base , next time if i open this pdf file i need to auto fill this matched fields in pdf file.


Can any one gudie me right direction please.


Row cannot be located for updating. Some values may have been changed since it was last read

  

hi SharePoint Gurus,

I am deeply stuck with one issue

Description Infopatth 2007/2003: InfoPath cannot submit the form. An error occurred while the form was being submitted. Row cannot be located for updating. Some values may have been changed since it was last read

This is really frustating me as this happens only some time where as other time it is working fine. My questions are :-

1) On How to re-produce this error? Because re-produce means it can be resolved as well hopefully?

2) Secondly the possible permanent solution to this.

I have search on google & bing with no feasible solution as yet. The thread below mentioned something which doesn't help me at all.

http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/682f2f2b-9fc8-44c2-8d4a-208c88436d33

Require Help Urgent Please !!!.


How to read PDF using Asp.net(C#.net) and store values in Database

  

Dear All,

Please try to guide me how to achieve this one. my application need to do reading the PDF document and want to store the values in Database.

Actually what happens is my customers sends me the OCR scanned copied in the form of PDF file. i need to read those scanned pdf files and store the customer information into my  table.

please try to help me how to do this..


Thanking uou,


Sant

santhoshsalugu@hotmail.com



wpf Datagrid bound to a Simple List of Long values - not so simple

  

Somewhere I've lost the plot.  I have a complicated senario, and solved most of it, but still I have one issue that illudes me.  Here goes

User Control has custom Dependancy Properties so that it can bind to it's host window.  One property Route is a string.  The string is actually a comma delimited list of long (BigInt stored values in SQL 2008r2 - pulled through a DataSet, then parsed into a string) ex.  "9,6,12"  Real simple so far.  The user control binds a CollectionViewSource to this string, and uses a custom converter to turn the string into a list(of long)... (or ObservableCollection(of Long), or BindingList(of Long))  The key is the value must be a long, when pulled.  Next enters the DataGrid...

I have a datagrid with 1 column.  Its a DataGridComboBoxColumn.  Its item source is bound to an actual dataset.datatable based CollectionViewSource called RoutingLocations.  A simple list of ID,Abbrev,LocationID.  I bind the DisplayValue to Abbrev.  So I get a nice lookup of the RoutingLocations in the comboBox Column.  Then my list(of Long) gets attached to the DataGrid as it's ItemSource.  End Result  I get 3 rows properly displaying the selected Abbrev for the supplied ID.

Now the problem.  I can not get this datagrid to update the source (it nev

Mapping values without long nested if statements

  

I have to do this twice in my SSIS package and I hate long confusing nested if statements.

I have to map text strings to a numeric value:

if 1 then "Apple"

else if 2 then "Orange"

These mappings are not in the database (that would make my life too easy) so I have to do it programatically.  Other than using the derived column transform and a long nested if statement ( «boolean_expression» ? «when_true» : «when_false») is there any way to do this?


Read xml values

  

<?xml version="1.0" encoding="utf-8" ?>
<rprarameters>
 <dpfilter values="Y"  />

<compriodd isdds="Y" codevalue="200901" codevaluee="200901"  iscode="N" /> 
 <customfilter>
      <isSelected value="srabcc" />
      <sracode value="020001" />
      <sracode value="209001" />
 </customfilter>
</rprarameters>

Need to fe

How to read/deserialize the PageSettings blob used by web parts

  

Does anyone know how to read or inspect the PageSettings column inside the aspnet_PersonalizationPerUser table to see what types of customizations users have made to their web part portal pages? Thank you.


Using the Client Object Model to read values from Excel file produces 504 error

  

Hi,

I use the Client Object Model to retrieve and read values from an Excel file. This is triggered in an Event Receiver on the Document Library where the Excel file lives. I use a simple CAML Query to retrieve the file. This has worked just fine on a dev/test server. 
Now, I just recently deployed this solution to a production/live server and now this code doesn't work anymore. I get an error saying 'The remote server returned an error: (504) Gateway Timeout'. This happnes when I try clientContext.ExecuteQuery();

The difference between the two servers is that on the test server (where it works) the solution is sitting as the root site, so to speak. No host headers or nothing.
On the live server, there are several web applications (SharePoint) on the same port, but with different host headers.

I have tried to trace a little bit and I found that on the test server, the url that is used to create the ClientContext object is 'http://<servername>/<webname>'. The url is comes from the following code: web.Url. I tried changing the url to the DNS name the test server has and that resulted in the same error as on the live server.

Does anyone have any idea what I need to do?

Thanks a billion!


How to Pass Values Between Web Pages ASP.NET

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

How to Pass Values Between ASP.NET Web Pages

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

Serial Port Communication Read and Write using C#.net

  
In this simple article you will learn that how you can Open and read COM port data using System.IO.Ports Namespace.
Simply just create New Project of windows application in C#.

Import ServiceProcess APIs
C#:
---
using System.IO.Ports

VB
Imports System.IO.Ports

Write Parsing functions which parse port data according to attached device

jquery autocomplete multiple values

  

i got some samples and i did autocomplete using jquery , its working well for single input values

but i need to pass multiples values after one by one in the textbox. Is it possible to pass multiple

values in the textbox for autocomplete in jquery in asp.net?

 


Scripts not read when in head tag

  

I just upgraded to VS2010 if that matters.  I'm learning JQuery and noticed that scripts don't work if they're in the head tag.  Also, I need the script tag with type="text/javascript" in the head (with nothing else) in order for the JQuery scripts in the body to work.

Very bizzare, any suggestions?

With a separate script tag in the <body> with my JQuery script, this works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">
</script>
</head>


This doesn't:

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
</head>



JQGrid Loading deleted values

  

Hi,

This is quite strange. here is the issue:

Some Info:

1. I'm using a multi-select jqgrid.

2. I have my own delete button to delete multiple orders

The problem:

When i press the delete button on the pager of my jqgrid, the records are deleted from the database but JqGrid shows some records (4-5). On refreshing the grid, correct numbers of records are shown.


Here is the code:


function delorder() {
        var amg = $("#horder").getGridParam('selarrrow');
        var cont = amg.length;
        if (amg.length > 0) {

How to cast integer values as an array of enum values?

  

Hello all!

I'm working with VS2010 Beta2, ASP.NET and Dynamic Data. I'm using VB but will certainly be happy to receive a C# example if necessary. Laughing

I used a few of Steve's examples (Writing Attributes and Extension Methods for Dynamic Data and Dynamic Data - Hiding Columns in selected PageTemplates) to create a custom property attribute to be applied to a dynamic data column and want it to accept an array of enum values (each value will represent a dynamic data page template where this column should not be displayed).  My new attribute works fine when I hardcode it like this, meaning the HideColumnIn attribute is properly populated with the array of enum values:

<HideColumnIn(PageTemplate.List, PageTemplate.Edit)> _
Public Property My_DD_Column As Object

 

However, I want to store the values to be used for the HideColumnIn in the DB as integer values that correspond to the

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend