Tag: merge

插入一行有一列datagridview c#

我想在c#.net winform中的一个datagridview中插入一行,它有一个单元格(这意味着合并单元格)。 我使用此行作为后续行的标题。 有什么解决方案可以满足这种需求吗? TNX

ItextSharp中的Pdf合并问题(合并Pdfs后不保留其值)

我们正在尝试使用ITextSharp合并三个PDF。 问题是合并后我们只能从第一个PDF获取数据,而其他两个PDF不保留其值。 所有这些PDF都具有相同的结构(即它们使用相同的模板和不同的数据),因此我的假设是它们具有相同的字段(AcroFields),这可能会在合并时产生此问题。 这是合并代码: public void MergeFiles(string destinationFile, string[] sourceFiles) { try { int f = 0; string outFile = destinationFile; Document document = null; PdfCopy writer = null; while (f < sourceFiles.Length) { // Create a reader for a certain document PdfReader reader = new PdfReader(sourceFiles[f]); // Retrieve the total number of pages int […]

合并两个SQLite数据库文件(C#.NET)

我正在使用C#/ .NET和SQLite的C#包装器。 我正在尝试将两个SQLite数据库合并在一起,同时排除重复项。 我找到了这个,这是从几个不同的论坛问题中引用的。 http://old.nabble.com/Attempting-to-merge-large-databases-td18131366.html 我尝试了下面的查询,我从我提供的链接构建,但它们导致exception,数据库根本没有合并,并且原始数据库不会发生任何变化。 attach ‘c:\test\b.db3’ as toMerge; insert into AuditRecords select * from toMerge.AuditRecords; 这是我的查询代码。 public void importData(String fileLoc) { SQLiteTransaction trans; string SQL = “ATTACH ‘” + fileLoc + “‘ AS TOMERGE”; SQLiteCommand cmd = new SQLiteCommand(SQL); cmd.Connection = connection; connection.Open(); trans = connection.BeginTransaction(); int retval = 0; try { retval […]

C#:连接2个MP3文件

我尝试使用下面的代码连接2个MP3文件。 我有一个新文件,我可以播放上半部分(完成第一个文件),但下半部分是静音。 新文件的长度是正确的。 我做错了什么? List files = new List(); var tempfile = File.ReadAllBytes(Path.Combine(path, “1.mp3”)); files.Add(tempfile); tempfile = File.ReadAllBytes(Path.Combine(path, “2.mp3”)); files.Add(tempfile); Byte[] a=new Byte[files[0].Length+files[1].Length]; Array.Copy(files[0], a, files[0].Length); Array.Copy(files[1], a, files[1].Length); File.WriteAllBytes(Path.Combine(path, “3.mp3”) , a);

将两个或多个Crystal Reports合并为单个PDF

我有一个CheckBoxList。 如果我选择两个或多个值,则CheckBoxList SelectedValues将作为参数逐个传递,我想为PDF格式的每个SelectedValue生成Crystal Report,并且我想将所有Crystal Report PDF格式合并为单个PDF格式。 怎么做到这一点? 到目前为止,我只生成了PDF格式的单个Crystal报表。 在下面,我已经提供了有关如何以PDF格式生成Crystal报表的代码。 CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); string conn = ConfigurationManager.ConnectionStrings[“ConnectionString”].ToString(); string[] str = conn.Split(‘;’); string server = str[0].Substring(str[0].IndexOf(” = “) + 3); string database = str[1].Substring(str[1].IndexOf(” = “) + 3); string userid = str[2].Substring(str[2].IndexOf(” = “) + 3); string password = “Welc0me”;//str[3].Substring(str[3].IndexOf(” = “) + 3); rpt.Load(Server.MapPath(RepPath)); […]

使用C#在DatagridView中合并多个行标题

我有一个项目,我需要从数据库中查看Datagridview中的数据,它应该看起来像甘特图。 我想让Datagridview看起来像这样: Datagridview示例 我已经尝试过很多来自互联网的代码,但没有任何工作正常 例如: https : //social.msdn.microsoft.com/Forums/windows/en-US/87004d70-482a-4b86-ba18-371670254b6a/how-to-merge-headers-in-a-datagridview?forum = winformsdatacontrols 此外,我不知道如何将日值输入单元格/行标题 这就是我从一个月开始的日子 int year = DateTime.Now.Year; int Jan = 1; int daysInJan = System.DateTime.DaysInMonth(year, Jan);

如何在C#中合并2个video文件?

我需要将多个video文件(.wmv)合并在一起以获取单个wmv文件。 我该怎么做?

如何使用C#合并/加入MP3文件?

我有一个不同单词/短语的库,为了在目前建立句子,我将这些短语的组合添加到播放列表中以制作句子。 不幸的是,如果用户正在运行CPU密集型应用程序(我的大多数用户都是),那么句子中间可能会有几秒钟的延迟(在短语之间)。 为了解决这个问题,我想到了一种方法,它会将正确的MP3文件组合合并到一个合适的短语中,将其保存在%temp%目录中,然后播放这个应该克服问题的1个MP3文件我我遇到了差距。 在C#中最简单的方法是什么? 是否有捷径可寻? 文件相当小,每个文件长3-4秒,一个句子可以包含3-20个短语。

将多个word文档合并为一个Open Xml

我有大约10个word文档,我使用open xml和其他东西生成。 现在我想创建另一个word文档,我想逐个加入到这个新创建的文档中。 我想使用open xml,任何提示都会很明显。 以下是我的代码: private void CreateSampleWordDocument() { //string sourceFile = Path.Combine(“D:\\GeneralLetter.dot”); //string destinationFile = Path.Combine(“D:\\New.doc”); string sourceFile = Path.Combine(“D:\\GeneralWelcomeLetter.docx”); string destinationFile = Path.Combine(“D:\\New.docx”); try { // Create a copy of the template file and open the copy //File.Copy(sourceFile, destinationFile, true); using (WordprocessingDocument document = WordprocessingDocument.Open(destinationFile, true)) { // Change the document type […]