Hi,

I'm trying to print a document in landscape, but i'm only being able to print it in portrait.
I've searched for the problem but i haven't found a solution to the problem.
Can you, please help?
Here's the source code:

public void btnImprimir_Click()
{
    try
    {
        PrintDialog pDialog = new PrintDialog();
        pDialog.PrintQueue = System.Printing.LocalPrintServer.GetDefaultPrintQueue();
        pDialog.PrintTicket = pDialog.PrintQueue.DefaultPrintTicket;

        // set default paper size or remove this line to use the default size 
        pDialog.PrintTicket.PageMediaSize = new System.Printing.PageMediaSize     
            (System.Printing.PageMediaSizeName.ISOA4Rotated); 

        Nullable<Boolean> print = pDialog.ShowDialog();
        if (print == true)
        {
            W.MyFlowDocument.PageWidth = 2950;
            W.MyFlowDocument.PageHeight = 2100;
            DocumentPaginator myDocumentPaginator = ((IDocumentPaginatorSource)W.MyFlowDocument).DocumentPaginator;
            //myDocumentPaginator = new DocumentPaginatorWrapper(myDocumentPaginator, new System.Windows.Size(750, 1200), new System.Windows.Size(48, 48));
            myDocumentPaginator = new DocumentPaginatorWrapper(myDocumentPaginator, new System.Windows.Size(2950, 2100), new System.Windows.Size(48, 48));
            myDocumentPaginator.PageSize = new System.Windows.Size(2950, 2100);

            pDialog.PrintDocument(myDocumentPaginator, "Test");
        }
    }
    catch (Exception err)
    {

    }
}

I've an application build with C# and WPF, that is being developed by 3 developers, including me.
On a certain stage of the application, an error came up that we can't determine how it happened and how to solve it, so we ask for your help.
Although everything works well when compiling, and running the aplication, we can't see the window in design view. Instead we have the following error message on the Visual Studio IDE:

"An Unhandled Exception has occurred

Click here to reload the designer

Details:
System.ArgumentOutOfRangeException
startIndex cannot be larger than length of string.
Parameter name: startIndex
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at MS.Internal.Host.PersistenceSubsystem.ExtractSourceFileInfo(Uri uri)
at MS.Internal.Host.PersistenceSubsystem.FormatInnerXamlParseException(Exception ex)
at MS.Internal.Host.PersistenceSubsystem.ReportException(Exception ex, TextModel model, Int64 sourceVersion)
at MS.Internal.Host.PersistenceSubsystem.Load()
at MS.Internal.Host.Designer.Load()
at MS.Internal.Designer.VSDesigner.Load()
at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()
at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)
at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
at MS.Internal.Host.Isolation.IsolatedDesigner.Load()
at MS.Internal.Designer.DesignerPane.LoadDesignerView(Boolean isReload)"

We've tried to see if we could solve this using Expression Blend, but apparently everything is ok in Blend. We can see the window (although the programmers aren't using blend, so we need it to work in Visual Studio). I've installed SharpDevelop to see i the problem could be solved from it, but Sharpdevelop shows the window as a grey window, without any objects on it and has the following output:

The target "ResolveAssemblyReferences" does not exist in the project.

and when building gives the following output:

Build started.
Warning MSB3247: Found conflicts between different versions of the same dependent assembly.
Build finished successfully. ...

Because for registring a company (and maintaining it) i need money

I want to create a website to sell software over the internet. I know i can use paypal to receive payments. I've been looking at the paypal documentation and i can't find the answer to my question.
I don't have a company, i'm a freelancer doing my own work for one day, with luck open my own company.
Is there any way, using paypal, or some other system to generate an invoice to a client buying a product in my website? What can / should i do in order to be legal?

My thanks in advanced

I want to create a website to sell software over the internet. I know i can use paypal to receive payments. I've been looking at the paypal documentation and i can't find the answer to my question.
I don't have a company, i'm a freelancer doing my own work for one day, with luck open my own company.
Is there any way, using paypal, or some other system to generate an invoice to a client buying a product in my website? What can / should i do in order to be legal?

My thanks in advanced

Thank you Reverend Jim, i think that is exactly what we need!!!

Thank for your answer.

We've already tried ftp, but we aren't being able to access the server because of the router. When we try over our network, everything works fine, but when we try over the internet we don't have access. Our technician did not (yet) found a way to overcome this problem, that's why we are trying a solution, other than ftp.

I need to create an application (or find one application) that copies files from a computer to another, across the internet to create automatic backups. The target computer is a company server to which i have phisical access. The "source" computer(s) (several computers in several clients, that we - company, have also phisical acess).

Solutions like teamviewer, PcAnywhere,... just don't fit because we already use them but they don't allow to create automatic backups.

Does anyone knows how can i copy files across the internet, using VB .NET, from one computer to another?

My thanks in advanced

I'm creating a new functionality for an already existing software, made with VB .Net. This new functionality consists of rendering 3D objects on a specific form, and be able to move/rotate/resize/change,... those objects.
For this task i've used XNA.
I've created a new XNA Windows project and, in the specific form, i've placed a panel. When the form is instanciated i give the Panel1 handle to the XNA project which i use to create the GraphicsDeviceManager.
Everything is working well, except for a window that is shown every time i call the VB .Net form. This windows has the VB .Net project name on its caption. If i try to minimize this new window, the objects stop rendering on the Panel.
Why does this windows appears?
How can i Close it, or hide it?

I need to save a video as an image in silverlight, for my new webpage functionality, at [url]http://www.game4tress.com/ecardsender.aspx[/url]. Now, this would be easy in WPF, but seems that silverlight can't access the RenderTargetBitmap and BitmapEncoder. I was able to discover that RenderTargetBitmap can be replaced with WriteableBitmap, but i can't replace BitmapEncoder.
If the function was made in WPF, i would use this code:
[code]
myCanvas.HorizontalAlignment=HorizontalAlignment.Stretch;

int Height=(int)myCanvas.ActualHeight;
int Width=(int)myCanvas.ActualWidth;

RenderTargetBitmap bmp=new RenderTargetBitmap(Width,Height,96,96,PixelFormats.Pbgra32);

bmp.Render(myCanvas);
BitmapEncoder encoder=new JpegBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bmp));

using(System.IO.Stream stm=System.IO.File.Create("C:\Temp.jpeg"))
{
encoder.Save(stm);
stm.Dispose();
}
[/code]
I can't seem able to find an equivalent way out in Silverlight. Can you, please help?
My thanks in advanced

I'm creating a new functionality in my website. An e-card sender.
[url]http://www.game4tress.com/ecardsender.aspx[/url]
My problem is that i can initialize the webcam but i cannot set the image (source,...) inside an image control.
I've tryed several thinks and google about it, but i found nothing.
My main goal is to set the imgMain control source property to the video that is being displayed inside the Ellipse or directly set the webcamBrush to the imgMain.Source, so i could be able to show it to the user and send it to the desired e-mail
Can you please help?
My thanks in advanced

This is the code:

[code]
Dim webcamBrush As VideoBrush
Dim el As Ellipse

If Not CaptureDeviceConfiguration.RequestDeviceAccess() Then

Else
Dim videoDevice = CaptureDeviceConfiguration.GetAvailableVideoCaptureDevices()

Dim cs = New CaptureSource()
cs.VideoCaptureDevice = videoDevice(0)
webcamBrush = New VideoBrush
webcamBrush.SetSource(cs)

el = New Ellipse()
el.Fill = webcamBrush
el.Width = 400
el.Height = 400
cs.Start()
[/code]

I think that my website
[url]http://www.game4tress.com[/url]
has performance issues when dealing with classes. If i let each web page load for some time, it works fine, if when the web page loads i immediately click on a link, some times the page craches and gives me an "unknown error" in a class. Is this possible? is there any workarround?

my thanks in advanced

I have a web portal
[url]http://www.game4tress.com[/url]
that loads a series of databases. Most of the time, everything works fine, but certain times, especially on google chrome, if i click too fast on a link, inside the main page (to play a certain game), i get an (unknown) error message when accessing the database.
Is there any techinque to ensure that everything is loaded before presenting the page, or any other way that i can use?

My thanks in advanced

in the Microsoft document
[url]http://msdn.microsoft.com/en-us/library/bb243815(v=office.12).aspx[/url]
there is the following statment:
"The tables underlying a Recordset object may not permit you to modify data, even though the Recordset is of type dynaset or table, which are usually updatable. Check the Updatable property of the Recordset to determine whether its data can be changed. If the property is True, the Recordset object can be updated."

So the question is, why can't the Recordset object modify data? I guess that is the problem happening in my situation

Thank you for your reply.
I've tryed that but the problem remains

Set rsTesteSQL = DBTesteSQL.OpenRecordset("SELECT * FROM teste", dbOpenDynaset, 0, dbOptimistic)

Hi

I need to migrate an application from MS Access to SQL Server (2005), and i'm using the code bellow, but i'm getting an error when the compiler reaches the AddNew instruction. It gives me "Run-time error '3027': Can't update. Database or object is read-only".

[code]
Dim DBTesteSQL As Database

Dim rsTesteSQL As Recordset

Set DBTesteSQL = OpenDatabase("", dbDriverNoPrompt, False, "driver={SQL Server};server=ABC\CDF;uid=XXX;pwd=XXXXX;Trusted_Connection=No;APP=Visual Basic;database=MyDatabase")

Set rsTesteSQL = DBTesteSQL.OpenRecordset("SELECT * FROM test", dbOpenTable, 0, dbOptimistic)

Debug.Print rsTesteSQL.Updatable

rsTesteSQL.AddNew

rsTesteSQL("name") = "reg"

rsTesteSQL.Update

rsTesteSQL.Close: DBTesteSQL.Close

Set rsTesteSQL = Nothing

Set DBTesteSQL = Nothing
[/code]

As far as i can tell, the problem comes from the line:

Set rsTesteSQL = DBTesteSQL.OpenRecordset("SELECT * FROM test", dbOpenTable, 0, dbOptimistic)

because if i try to add records through the following line of code, it works:

DBTesteSQL.Execute "Insert Into teste (nome) VALUES ('abcdef')"

So the problem comes from the recordset,but the return value from the following line is False

Debug.Print rsTesteSQL.LockEdits

meaning that i should be able to write to the database, but the following line also returns false

Debug.Print rsTesteSQL.Updatable

meaning that i can't make updates to the database. So i can only conclude that the problem comes from the options parameter

dbOpenDynaset

but i can't seem to find a way to solve this.

Can anyone help me?

My thanks in advanced