|
I'm on Vista and getting code 2869, no further explanation. I've googled it for a bit and now suspect it's a security problem. This would mean the p/invoke call is actually good now. This is the code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Runtime.InteropServices;
using System.Text;
using System.Diagnostics;
namespace InstallationHelper
{
[RunInstaller(true)]
public partial class InstallationHelper : Installer
{
[DllImport("mscoree.dll")]
static extern int GetCORSystemDirectory(
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] StringBuilder buffer,
Int32 buffer_length,
ref Int32 length
);
public InstallationHelper()
{
InitializeComponent();
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Install(System.Collections.IDictionary savedState)
{
base.Install(savedState);
string Args = this.Context.Parameters["Args"];
if (Args == "")
{
throw new InstallException("No arguments specified");
}
System.Text.StringBuilder Path = new System.Text.StringBuilder(1024);
int Size = 0;
GetCORSystemDirectory(Path, Path.Capacity, ref Size);
Process P;
ProcessStartInfo Si = new ProcessStartInfo(Path.ToString() + "ngen.exe", "\"" + Args + "\"");
Si.WindowStyle = ProcessWindowStyle.Maximized;
try
{
P = Process.Start(Si);
P.WaitForExit();
}
catch (Exception e)
{
throw new InstallException(e.Message);
}
}
}
}
Standards are great! Everybody should have one!
|
|
|
|
|
Yes, according to google it looks like a problem with permissions and vista. You could try running it on XP or calling unmanaged function from a normal windows application so that you can set breakpoint.
|
|
|
|
|
Ok, problem solved! Cleaning up seems to be the right thing to do here: Just removing the constructor was enough to get the thing going for some reason . Thanks a bunch Giorgi, you've been a real help!
Standards are great! Everybody should have one!
|
|
|
|
|
Glad to help you
|
|
|
|
|
I have a dataset with nested tables:
<a>
<b>
<c>
<first>1</first>
<second>2</second>
</c>
</b>
</a>
and I´m trying to write this dataset into a xml file, but I don´t want to write the first element of the dataset. I´m using the dataset1.WriteXml() method. I want the xml file to look like this:
<b>
<c>
<first>1</first>
<second>2<second>
</second></second></c>
</b>
How can I accomplish this? Can anyone help me please?
cellardoor
|
|
|
|
|
Hi all,
I have the following piece of code that adds a new tab to a tabpage control.
...
RichTextBox rtext = new RichTextBox();
rtext.Dock = DockStyle.Fill;
tabControlMain.TabPages[tabControlMain.TabPages.Count-1].Controls.Add(rtext);
...
Now I am trying to load some different file(s) into the newely created richtextboxes found on each of the newely created tabs. And this is were I get stuck. How can I access the RichTextBox created on the new tab and be able to load a file into it??
Can anyone please help??
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
If there is only richtextbox on the tab and no other controls, you can access it like this: tabControlMain.TabPages[tabControlMain.TabPages.Count-1].Controls[0] Another way is to assign name to the richtextbox before you add it to the tab and access it through its name: tabControlMain.TabPages[tabControlMain.TabPages.Count-1].Controls["richtextboxname"]
Don't forget to cast it to richtextbox.
|
|
|
|
|
|
There is no need to have a separate array of richtextboxes that hold the reference.
|
|
|
|
|
I.E. if oen would do it like this, there would be no need .... right ?
RichTextBox text = (RichTextBox)tabControlMain.TabPages[tabControlMain.TabPages.Count - 1].Controls[0];
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Right!
|
|
|
|
|
|
You are welcome
|
|
|
|
|
hi all
i want to show a column value from datatable.I tried as below . it doesnt shows the values.
pls help.
SqlDataAdapter adpt = new SqlDataAdapter(cmd);<br />
DataTable dtCust1 = new DataTable("CustomerDatTab");<br />
adpt.Fill(dtCust1);<br />
<br />
dataGridView1.DataSource=dtCust1;
<br />
<br />
DataRow dr = new DataRow();<br />
foreach (DataRow dr in dtCust1.Rows)<br />
comboBox1.Items.Add(dr.ToString());<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
thank u
senthil
|
|
|
|
|
kssknov wrote: i want to show a column value from datatable.I tried as below . it doesnt shows the values.
Yes, you can get values from your DataTable. You could get them from either the DataGridView, or from the DataTable itself I'm just going to show you how to get them from the DataTable. Lets say you want to get all values from a specific column, here's how you would do it:
for (int rowIndex = 0; rowIndex < yourDataSet.yourDataTable.Rows.Count; rowIndex ++)
{
for (int columnIndex = 0; columnIndex < yourDataSet.yourDataTable.Columns.Count; columnIndex ++)
{
Console.WriteLine(string.format("Row {0}, Column {1} cell value is {2} !", rowIndex.ToString(),
columnIndex.ToString(), yourDataSet.yourDataTable.Rows[rowIndex][columnIndex].ToString()));
}
}
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
As length property give complete number of elements in the array. But if only i want to know count of only not null values elements of the array what should be the method or property need to be used.
Thanks in Advance.
|
|
|
|
|
I don't think there's anything built in, so you'd probably have to iterate through the entire collection and keep a count yourself.
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
Please redirect me to some working code in C#.NET to convert a word file into a PDF. I need it urgently....
Thanks in advance...
Vruddhi
|
|
|
|
|
If it's urgent, get out your credit card and google for a commercial product. If it's not that important, google for free code and take your chances.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Vruddhi Vasoo wrote: Please redirect me
Sure. It is a pleasure.
Response.Redirect("http://www.google.com/");
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Vasudevan Deepak K wrote: Sure. It is a pleasure.
Response.Redirect("http://www.google.com/");
You have learned well. The force is strong with you.
|
|
|
|
|
Vruddhi Vasoo wrote: Please redirect me to some working code
Why don't you do a little work yourself? Use google, MSDN, try to write at least a little code...
Vruddhi Vasoo wrote: I need it urgently....
I bet you do, but guess what? No one gives a flying rat's ass what you want or when you need it.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
|
This is after ages I may be adding a comment to the thread, but thought like sharing info I had on my exp.
There are no built in libraries in dot net to convert from word to PDF, in this context its a good practise to use third party's like Abcpdf.dll where you can even embed images with paging in generated pdf.you can further refer to "http://dotnetf1.blogspot.com/2008/07/convert-word-doc-into-pdf-using-c-code.html" for third parties which are available for free of cost.
modified on Wednesday, September 3, 2008 8:55 AM
|
|
|
|
|
Hi
I have a string called db1 which contains a code value
I need to set this string as a global session for the page.
What is the syntax for this, I have tried
Session["gdb1"] = db1;
however the session appears to be blank??
thanks in advance
|
|
|
|