Quantcast
Channel: CSharp Forum Latest Questions
Viewing all 32060 articles
Browse latest View live

GemBox.Document - C# / VB.NET Word component

$
0
0
GemBox.Document is a C# / VB.NET Word component for easy and efficient Word document processing in .NET without Microsoft Word.
GemBox.Document 2.1 supports reading DOCX and HTML formats and writing, creating and converting to DOCX, PDF, XPS, HTML and image formats.

GemBox.Document has following advantages:

·  Unified programming interface for multiple document formats (DOCX, PDF, XPS, HTML). More »
·  Rich Set of Features. More »
·  No dependency on Microsoft Word.
·  Many times faster than Microsoft .NET Word automation. More »
·  Plain and fair licensing. More »
·  100% managed code (C#), follows .NET class library design guidelines.
·  Simple and easy-to-use programming interface. More »
·  Preserves unsupported file format features. 

For more details go to GemBox.Document features page or use GemBox.Document Sample Explorer.

GemBox.Document common uses:

·  Open Word document in C# / VB.NET.
·  Create Word document in C# / VB.NET.
·  Edit Word document in C# / VB.NET.
·  Print Word document in C# / VB.NET.
·  Convert HTML to / from Word in C# / VB.NET.
·  Convert HTML to PDF in C# / VB.NET.
·  Convert Word to PDF in C# / VB.NET.
·  Create PDF in C# / VB.NET.
·  Export to Word / PDF from ASP.NET application.
·  Generate reports using .NET mail merge.

Free mode

You can download GemBox.Document Free setup and evaluate GemBox.Document free of charge and for an unlimited time period. Free version is limited to 20 paragraphs.

Trial mode

To evaluate beyond the first 20 paragraphs, handle ComponentInfo.FreeLimitReached event and set the FreeLimitEventArgs.FreeLimitReachedAction to FreeLimitReachedAction.ContinueAsTrial, as in this following code snippet:

C#
// Set license key to use GemBox.Document in a Free mode.
ComponentInfo.SetLicense("FREE-LIMITED-KEY");

// Continue to use the component in a Trial mode when free limit is reached.
ComponentInfo.FreeLimitReached +=
       (sender, e) => e.FreeLimitReachedAction = FreeLimitReachedAction.ContinueAsTrial;

// Here goes your application specific code.

VB.NET
' Set license key to use GemBox.Document in a Free mode.
ComponentInfo.SetLicense("FREE-LIMITED-KEY")

' Continue to use the component in a Trial mode when free limit is reached.
AddHandler ComponentInfo.FreeLimitReached,
       Sub(sender, e) e.FreeLimitReachedAction = FreeLimitReachedAction.ContinueAsTrial

' Note: Single-line Sub Lambdas are supported from Visual Basic 10 compiler.
' See: http://msdn.microsoft.com/en-us/library/ff637436.aspx#code-snippet-5
' If you are using Visual Basic 9 or older Visual Basic compiler,
' then you must extract event handler to a method and assign it as an event handler.
' Here goes your application specific code.

This option will enable you to read / write entire document content, with the following limitations imposed after the first 20 paragraphs:
  • When loading a document - random parts of document text will be replaced with string TRIAL.
  • When saving a document - promotional header will be added to every document page and will replace any existing header.
For more information, see GemBox.Document Evaluation 

Professional mode

If you want to use the component in a professional mode – without any limitations – you need to purchase the license key. For more information about evaluation and licensing, see here.

We hope GemBox.Document will improve developer's productivity and functionality & efficiency of document processing / reporting applications.



GemBox.Spreadsheet - C# / VB.NET Excel component

$
0
0
GemBox.Spreadsheet is aC# / VB.NET Excel component for easy and efficient Excel file processing in .NET without Microsoft Excel.
GemBox.Spreadsheet 3.7 supports reading XLSX, XLS, ODS and CSV formats and writing, creating and converting to XLSX, XLS, ODS, CSV, HTML, PDF, XPS and image formats.

GemBox.Spreadsheet has following advantages:

·  Unified programming interface for multiple file formats (XLSX, XLS, ODS, CSV, HTML, PDF and XPS). More »
· Rich Set of Features. More »
· No dependency on Microsoft Word.
· Many times faster than Microsoft .NET Excel automation. More »
· Plain and fair licensing. More »
· 100% managed code (C#), follows .NET class library design guidelines.
· Simple and easy-to-use programming interface. More »
· Preserves unsupported file format features. More »

For more details go to GemBox.Spreadsheet features page or use GemBox.Spreadsheet Sample Explorer.

GemBox.Spreadsheet common uses:

·  Read & write Excel and HTML files in C# / VB.NET.
·  Create Excel and HTML files in C# / VB.NET.
·  Convert between Excel and HTML formats in C# / VB.NET.
·  Convert Excel file to PDF in C# / VB.NET.
·  Print Excel file in C# / VB.NET.
·  Export to Excel / PDF from ASP.NET.
·  Import & export DataSet to Excel in C# / VB.NET.
·  Import & export DataTable to Excel in C# / VB.NET.
·  Import & export DataGridView to Excel in C# / VB.NET.

Free mode

You can download GemBox.Spreadsheet Free setup and evaluate GemBox.Document free of charge and for an unlimited time period. Free version is limited to 150 rows per sheet and 5 sheets per workbook.

Trial mode

To evaluatebeyond the first 5 worksheets and 150 rows, handle SpreadsheetInfo.FreeLimitReached event and set the FreeLimitEventArgs.FreeLimitReachedActionto FreeLimitReachedAction.ContinueAsTrial, as in this following code snippet:

C#
// Set license key to use GemBox.Spreadsheet in a Free mode.
SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY");

// Continue to use the component in a Trial mode when free limit is reached.
SpreadsheetInfo.FreeLimitReached +=
       (sender, e) => e.FreeLimitReachedAction = FreeLimitReachedAction.ContinueAsTrial;

// Here goes your application specific code.

VB.NET
' Set license key to use GemBox.Spreadsheet in a Free mode.
SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY")

' Continue to use the component in a Trial mode when free limit is reached.
AddHandler SpreadsheetInfo.FreeLimitReached,
       Sub(sender, e) e.FreeLimitReachedAction = FreeLimitReachedAction.ContinueAsTrial

' Note: Single-line Sub Lambdas are supported from Visual Basic 10 compiler.
' See: http://msdn.microsoft.com/en-us/library/ff637436.aspx#code-snippet-5
' If you are using Visual Basic 9 or older Visual Basic compiler,
' then you must extract event handler to a method and assign it as an event handler.
' Here goes your application specific code.

This option will enable you to read / write entire spreadsheet content, with the following limitation imposed on all cells after the first 5 worksheets or 150 rows per worksheet, whichever comes first:
  • When loading / saving a spreadsheet - approximately 5% of (randomly selected) cells will have their value replaced with string TRIAL.
For more information, see GemBox.Spreadsheet Evaluation help page.

Professional mode

If you want to use the component in a professional mode – without any limitations – you need to purchase the license key. For more information about evaluation and licensing, see here.

We hope GemBox.Document will improve developer's productivity and functionality & efficiency of document processing / reporting applications.


Get PayKey from Paypal

$
0
0
I want to integrate pay pal payment option in my website with a lightbox open.
for this I need pay key which generated from paypal site.
How it is possible.Please help me with proper code.

Thanks in Advance.

asp.net

$
0
0
hello,

       i have a field in my table isadmin where if he is admin it is 1 otherwise it is set to 0.
on a page load i want to show my gridview  so i am wiritting   this code .


SqlCommand cmd = new SqlCommand(" select fname,lname from UserInfo where IsAdmin=@IsAdmin" , cn);
                    cmd.Parameters.Add(new SqlParameter("@IsAdmin" i want here  that isadmin should take 0 so that it will display rows what to write here ));

                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    DataSet ds = new DataSet();
                    da.Fill(ds);
                    GridView1.DataSource = ds;
                    GridView1.DataBind();

Record Landline Phone Call in c#

$
0
0
how to record landline phone call using c# on server

Resizing vertically FlowLayoutPanel on Paint Event Handler??

$
0
0

I am creating a Office 2010 Add In which should behave like Toolbar available in Word 2003.
I should be able to resize Custom Task Pane when it is in floating Mode.
In Word 2003 we can use CommandBar class to accomplish this functionality but not in Word 2010.

I have created a add in for Woed 2010 in which I have a Custom Task Pane which contains controls in following hierarchy.

Custom Task Pane
        USer Control
                Flow Layout Panel 
                        ToolStrip
                                ToolStripButton


I wrote a Paint Event of Flow Layout Panel.
    flow.Paint +=new PaintEventHandler(flow_Resize);

I am able to resize the Custom Task Pane from left and right side but not from Top or Bottom when it is Floating. Please help.


How to Recover My Excel File Password?

$
0
0

I have an excel file which i have not open for almost 6 months and I have forgotten the password. Is there a way i can retrieve password.
I have searches on internet but not getting a perfect recovery.

Enter Key Finction in C#

$
0
0
Sir, I have about 20 textBoxe ,10 comboBox and 5 dateTimePicker in a form.

as I want to go cursor downward through each textbox whenever I press 'Enter' Key.

I coded:-

if(e.KeyCode==Keys.Enter)
{
txtLastName.Focus()// goes from txtFirstName to txtLastName
}


I am tired of writing this code in each textBox of my form.

is there an unique code to define these function  in a form, i.e keydown event defines for 25 textboxes.?

how to select multiple Label With ctrl+shift in C#.net

$
0
0

I have multiple Label values and  I want to select multiple label values Ctrl+Shift in windows form c#.net.
How can resolve it.

With Regards
Bvenkat Jeewesh


Data modeling Diagram ?

$
0
0

Need Answer for 2 and 3 Questions


A database that is used for keeping track of information about the votes taken in the US House of Representatives during the current two-year congressional session. The database needs to keep track of each US State's name (e.g., 'Textas', 'Newyork', Califonia') and include the region of the state (whose domain is {'Northeast', 'Midwest', Southeast', 'Southwest', 'West'}). Each CONGRESS-PERSON in the House of Representatives is described by his or her Name, plus the District represented, The Start-date when the congressperson was first elected, and the political Party to which he or she belongs (whose domain is { 'Republican', 'Democrat', Independent', and other}). The database keeps track of each BILL(i.e., proposed law), including the Bill_name, the Date_of_vote on the bill, whether the bill Passed_or_failed(whose domain is {'Yes', 'No'}, and the Sponsor(the congressperson(s) who sponsored- that is, proposed – the bill). The database keeps tracks of how each congressman voted on each bill (domain of Vote attribute is {'Yes', 'No', 'Abstrain', 'Absent'}.

 

1.     Draw an ER diagram

2.     Convert  the ER diagram to DM

      3 .  Give an event tracking factless fact table


Design an ER diagram for keeping track of information about votes taken in the U.S. House of Representatives during the current two-year congressional session…. Draw an ER schema diagram for the above application. State clearly any assumption you make.

 

Entities:

 

STATE

Name, RegionOfState

 

CONGRESSPERSON

Name (FName, MInit, LName), District, StartDate, PoliticalParty

 

BILL

BillName, PassedOrFailed,

 

 




                                                                

Export to Exce;

$
0
0
in .net i have code to down load file (Excel or any file),but i could not display label message with successfully downloaded after downloading excel or any file...

is this possible to display successful message after downloading is completed.

if it is possible ,let me know the solution

Passing variables to stored procedure

$
0
0
Hi,

I'm trying to pass a few variables to a stored procedure i have created in mssql. The procedure is working fine. Via my webinterface I would like to pass a few variables to the procedure but I cant seem to get it to working.

On the webinterface I have some textboxes which is first filled by a select statement. Then the user can edit the info on the webinterface and press the edit button which will update the posts in the database. The filling of the textboxes is working just fine, but if I edit some text and press edit, nothing happens in my db. Seems like nothing is passed in the procedure.

Here's the code:


[quote]

        protected void soegButton_Click(object sender, EventArgs e)
        {
            using (SqlCommand soegning = new SqlCommand(@"SP_SelectSearchUser", conn))
            {

                soegning.CommandType = CommandType.StoredProcedure;

                soegning.Parameters.Add("@userInitials", SqlDbType.VarChar).Value = soegbruger.SelectedItem.Text;

                conn.Open();
                SqlDataReader reader = soegning.ExecuteReader();

                while (reader.Read())
                {
                    editFornavn.Text = reader["fornavn"].ToString();
                    editMellemnavn.Text = reader["mellemnavn"].ToString();
                    editEfternavn.Text = reader["efternavn"].ToString();
                    editInitialer.Text = reader["initialer"].ToString();
                    editAfdeling.Text = reader["afdeling"].ToString();
                    editTelefon.Text = reader["telefonnr"].ToString();
                    editMail.Text = reader["mail"].ToString();
                    current_id = int.Parse(reader["ID"].ToString());
                }
                reader.Close();
                conn.Close();
            }


        }

        protected void edit_Click(object sender, EventArgs e)
        {
            SqlCommand editUser = new SqlCommand("SP_UpdateUser", conn);
            editUser.CommandType = CommandType.StoredProcedure;

            editUser.Parameters.Add("@firstname", SqlDbType.VarChar).Value = editFornavn.Text;
            editUser.Parameters.Add("@middlename", SqlDbType.VarChar).Value = editMellemnavn.Text;
            editUser.Parameters.Add("@lastname", SqlDbType.VarChar).Value = editEfternavn.Text;
            editUser.Parameters.Add("@initials", SqlDbType.VarChar).Value = editInitialer.Text;
            editUser.Parameters.Add("@department", SqlDbType.VarChar).Value = editAfdeling.SelectedItem.Text;
            editUser.Parameters.Add("@phonenumber", SqlDbType.VarChar).Value = editTelefon.Text;
            editUser.Parameters.Add("@mail", SqlDbType.VarChar).Value = editMail.Text;

            editUser.Parameters.Add("@currentuser_id", SqlDbType.VarChar).Value = current_id;

            conn.Open();
            editUser.ExecuteNonQuery();
            conn.Close();

            Response.Redirect(Request.RawUrl);
         }

[/quote]



I appreciate any help! :)

thanks

/Troels

SharePoint 2010 - Search not working for Claims based FBA we

$
0
0
Hi

1.Search is working for Claims based FBA web application fine(Here we extend the web application and adding server name mapping,crawled extend web application). But when we use Custom XML site map providers search crawl will Raise a error like"The SharePoint item being crawled returned an error when attempting to download the item" and crawl will not return any result.Here we customize master page ribbon also i.e we set search box in ribbon,moved site actions in to right side,Help icon into ribbon also.

2.when we apply same changes for  Classic mode windows  web application working fine.


Please help if someone knows the solution.

Regards,

Hemachandra

pdfsharp and inner pairs

$
0
0
am trying to fill the fields of pdf form so I use the following code

stringfilePath=@"c:\test.pdf";stringnewPath=@"E\Result";if(File.Exists(filePath)){PdfDocument document =PdfReader.Open(filePath,PdfDocumentOpenMode.Modify);// Get the root object of all interactive form fieldsPdfAcroForm form = document.AcroForm;// Get all form fields of the whole documentPdfAcroField.PdfAcroFieldCollection fields = document.AcroForm.Fields;//"/Fields"string[] names = fields.Names;names= fields.DescendantNames;

the problem is that it give error A PDF name must start with a slash (/). also the acrofields contain only one 

I dsicoverd that the document.AcroForm has 4 pairs , on of them has key "/Fields" , how to reach it


I used itextsharp , and I can read them , but am need to use pdfsharp , if any help will be highly appretiated 

parameterised query fails

$
0
0

In the below example,If i pass a single value to mycompany variable say mycompany="100",
the below execquery() method works fine.But when i pass more than one value to parameter then it fails for the below case explained below.
please help me to to make it work.

let us say i have a method that uses the parameterised query like this:

number myid=1000;
var mycompany="100,102,104,105,106";

string sql=select * from employee where id=@0 and company in (@1);

the call to the below method takes place as below:

var dt=executequery(sql,conn,myid,mycompany)

and the method definition is given below:




publicstaticDataTable Executequery(string sql, string connectionString, paramsobject[] args)
{
using (var connection = newSqlConnection(connectionString))
using (var command = newSqlCommand(sql, connection))
{
var parameters = args.Select((value, index) => ToSqlParameter(command, index.ToString(CultureInfo.InvariantCulture), value));

command.Parameters.AddRange(parameters.ToArray());

if (connection.State == ConnectionState.Closed)
  connection.open();
 
var dr = command.ExecuteReader();
var dt = newDataTable();
dt.load(dr);
return dt;
}
}



and ToSqlparamer() method definition is given below:It takes the params from args and creates an sqlparameter and adds to it.


SqlParameter ToSqlParameter(SqlCommand command, string name, object value)
{

var p = command.CreateParameter();

p.ParameterName = name;

p.Value = value;


return p;
}


C# how obtain parameter values

$
0
0
I have a C# 2008/2010 application that is currently accessed as a dll file and  I would like to change the application so that the dll is accessed though as a reference. The code that calls the dll is a process and the code looks like the following:

Process theProcess = new Process();

theProcess.StartInfo = new ProcessStartInfo("filename.ext");

theProcess.StartInfo.Arguments = "args here"

theProcess.WaitForExit();

theProcess.Start();

I want to be able to pass argument values to the dll when it becomes a reference in the 5 programs that call it.
My problem is that I do not know how to pass the parameter values when the code is accessed as a reference. Thus can  you tell me how to pass argument values to the application when it is accessed as a reference. Is it something in the reference call? Can you show me code and/or tell me how to acoomplish my goal?

C# reference program in different directory locations

$
0
0
I have a C# 2008/2010 application that is currently accessed as a dll file and  I would like to change the application so that the dll is accessed though as a reference. The code that calls the dll is a process and the code looks like the following:

Process theProcess = new Process();

theProcess.StartInfo = new ProcessStartInfo("filename.ext");

theProcess.StartInfo.Arguments = "args here"

theProcess.WaitForExit();

theProcess.Start();

The problem is the dll is currently placed in various locations like unit test area, client acceptance testing, system testing, and then into production by the 5 applications that call it. The application currently obtains the various locations based upon values in the app.config file. If I add this dll has a reference to the programs that call it, how will I tell those calling programs where to obtain the 'correct' directory location? Would I use the app.config file?
Can you show me code and/or explain to me how to solve this issue?

help in section 3 in my project :(

$
0
0
here is  the project .. 
index 3 

Portfolio

IT student

$
0
0
I'm excellent student. Soon, first year of my studies will end, I tried to find summer job, and I got to interview, but in both enployee asked if I can work full time and study at evening. I said it is not possible in my university. So... Of course I'm going to study during the summer, but what else I could do??
Viewing all 32060 articles
Browse latest View live