|
If i use demand on either of them then it won't build anymore.
I get the following build error:
Assembly generation failed -- SecurityAction type invalid on assembly.
So I guess I can't demand it...
--Peter
|
|
|
|
|
Sometimes it does not let you at all.
Once I wanted to loop through a certain portion of the HD (forgotten why) but no matter how many sec permissions i got, it wouldnt let me do it.
Either because of a performance lag on computer or some sensitive files...
If your project sounds like it could provoke .NET in any of these areas, try changing it.
This is probably not the case, but worth a shot
|
|
|
|
|
hello,
I am creating a windows form app using VS.Net and I am having a fundamental problem with window sizing. I would like to specify the exact size of each form programmatically. Despite my efforts, the forms seem to be resizing themselves sometime between when the constructor is run and the window is actually displayed. Does anybody know why or where in the code this is happening? Any insight would be much appreciated.
Thanks!!!
rc
|
|
|
|
|
It may be that you are putting your programmatical assignment of the size before the InitialiseComponent() method in the form's constructor is being called, as a result the assignment to the form's size in InitialiseComponent() is overriding your assignment.
James
just-code-it.net
|
|
|
|
|
Does anyone know what's the equivalent of SelectedIndexChanged(object sender, System.EventArgs e) event of Win form ComboBox control in UltraCombo in Infragistics control. I want to raise a event only when UltraCombo value changes.
thanks
Share knowledge to enhance your learning
|
|
|
|
|
hi guys..
i've never faced with a problem like this, just want to ask u guys..
i declared a datetime component ..
<br />
DateTime x = new DateTime(1900,01,01,7,0,0,0);<br />
everything is fine.. let`s write it to a textbox name tBox;
<br />
tBox.Text = x.toLongTimeString();<br />
everything is ok.. i get 7:00:00
but after i add some minute to this instance..
<br />
x.AddMinute(15);<br />
tBox.Text = x.toLongTimeString();<br />
why the heck i get the 7:00:00 instead of getting 7:15:00 ?!?!?!
any thoughts ?
thanx
good coding
|
|
|
|
|
You have to assign the return value of AddMinute to your variable x. x itself isn't changed.
x = x.AddMinute(15);
tBox.Text = x.toLongTimeString();
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
thanx a lot..
good coding
|
|
|
|
|
Hi,
Iam using datagridview,How to add a new row to the datagrid view?
In insert button i wrote this code,
dataGridView1.Rows.Add(3);
when i run this code,it is giving the following exception
exception: rows cannot be programatically to the datagridview's collection when control is databound
In save button i wrote like this,
private void button1_Click(object sender, EventArgs e)
{da.Update(ds,"emp");
}
It is giving the following exception:
Update requires a valid InsertCommand when passed DataRow collection with new rows.
Please help me.
Thanks In Advance
|
|
|
|
|
You need to add the record to the collection the datagridview is bound to.
|
|
|
|
|
Hi,
Thanks For Your Reply.
My code is here:
private void Form1_Load(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection(str);
da= new OleDbDataAdapter("select * from dept", con);
da.Fill(ds, "dept");
dataGridView1.DataSource = ds.Tables["dept"];
}
private void button1_Click(object sender, EventArgs e)
{
dataGridView1.AllowUserToAddRows = true;
DataGridViewRow hetrow = new DataGridViewRow();
DataGridViewComboBoxCell ccell = new DataGridViewComboBoxCell();
ccell.Items.Add(10);
ccell.Items.Add(20);
ccell.Items.Add(30);
ccell.Items.Add(40);
hetrow.Cells.Add(ccell);
for (int i = 0; i < 2; i++)
{
hetrow.Cells.Add(new DataGridViewTextBoxCell());
}
ds.
dataGridView1.Rows.Add(hetrow);
Now How to add,
Please help me.
Thanks in advance
|
|
|
|
|
The problem is your binding object is a DataTable and you are trying to add a record to the datagridview not the DataTable. Do something like below:
DataTable dt = dataGridView.DataSource;
DataRow dr = dt.NewRow;
dt.Rows.Add(dr);
Mike Lassetetr
|
|
|
|
|
Hi All,
What are the main differences between these two Interfaces and when we should prefer which one???
and shud we implement these in the same class in which we r comparing or shud we make a new calss for that......also i m having problem implementing IComparer interface when i implement this the compiler gives this error
The type or namespace name 'IComparer' could not be found (are you missing a using directive or an assembly reference?)
so plz tell me also wots the solution of this
Looking forward for help
Regards,
-- modified at 12:38 Tuesday 23rd May, 2006
|
|
|
|
|
IComparer is defined in System.Collections. Thus you need to add using System.Collections; at the top of your code.
IComparable must always be implemented by the the class which should be sorted. IComparer should be implemented in separated classes. You should go with IComparer if you want to sort your objects by different criterias (e.g. by its name, some associated values...). Because IComparer can be separated from the class to be sorted you can have as much implementations as you like.
|
|
|
|
|
|
I'm trying to code an MDI windowing system where the names of the child windows are placed into a menu system at startup time. The problem that I'm having is how to invoke the child windows (from a string variable) after an option has been selected. I have thumbed through a lot of paper work on reflection but nothing really seems to match the requirment
Any Ideas guys
|
|
|
|
|
Did you try Activator.CreateInstance[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
Hello All,
I make two forms First is Login Form and second is "Change Password" form, when change password form opens here two fields are showed one for OldPassword and other for NewPassword, now my intension is that how i can update an old password
in the database (i'm using MSAccess database) tell me the command of Update even i know this command and also apply it but it dosen't work, it gives me error "Syntax error in UPDATE command" on runtime.
plz assist me in this way.
m.reehanmunir
|
|
|
|
|
that means there is a syntax error at the query string..
just show code and maybe there would be some help..
good coding
|
|
|
|
|
"this is my code now plz help me according to this" here "password" is database field;" thx
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\C#Projects\\practice1\\SMSDB.mdb;Persist Security Info=False");
con.Open();
string updata = "update SMSDB set password= '"+txtnewpwd.Text+"' where password='"+txtoldpwd.Text+"'";
OleDbTransaction tx = con.BeginTransaction();
tx.Commit();
OleDbCommand cmd = new OleDbCommand(updata,con);
cmd.ExecuteNonQuery();
con.Close();
m.reehanmunir
|
|
|
|
|
An example of what you are doing will be helpful. Did you remember to put quotes around the passwords?
It should look something like this:
UPDATE usertable SET password = 'newpassword' WHERE password = 'oldpassword';
When creating the UPDATE string, you will need to surround your password variables with the single quote. That is the only thing I can think of which may be causing the problem.
I sometimes find it helpful to use a SQL Editor for creating my SQL statements. It saves me a bunch of time from having to try and retry different commands through code. I don't use MSAccess so I am not sure what type of GUI editor they may have.
|
|
|
|
|
"This is my code now plz help me according to this code" here "password" is the field of database;"
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\C#Projects\\practice1\\SMSDB.mdb;Persist Security Info=False");
con.Open();
string updata = "update SMSDB set password= '"+txtnewpwd.Text+"' where password='"+txtoldpwd.Text+"'";
OleDbTransaction tx = con.BeginTransaction();
tx.Commit();
OleDbCommand cmd = new OleDbCommand(updata,con);
cmd.ExecuteNonQuery();
con.Close();
m.reehanmunir
|
|
|
|
|
It is not necessary to create a transaction. Transactions are used when you plan on doing several SQL calls and there is the possibility of a problem. If there is a problem, a transaction lets you rollback any change prior to anything being fully committed to the database.
In the case of the password, you have the one SQL statement and probably do not want it in a transaction. If you did want a transaction, the commit will need to be AFTER your Execute call. As it is, the Transaction in the code is not doing anything and can probably be removed.
Try putting a space between password and the '='.
|
|
|
|
|
Hi.
I am extracting fields from a FoxPro database.
For reasons that I won't go into, one of the character fields contains an array of 4 characters.
The first character is almost always a Unicode-null.
Now .. When I read this field using a System.Data.DataRow .. it thinks the field is a blank string (String.Empty).
This is because, a string variable is basically a character array, terminated by a unicode-null value.
My character array is therefore immediately terminated (as the first character is a null character).
How on earth do I extract these field values?
I can do this in VBA (in Access) using the same connection string. It returns a string of the individual unicode characters ... but in .Net (both C#.Net and VB.Net) I get returned a blank string.
HELP ?
My Code<br />
OleDbConnection _connection = new OleDbConnection( @"Provider=VFPOLEDB.1;Data Source=C:\DataFolder\;");<br />
<br />
string strSelect = "SELECT * FROM table1";<br />
<br />
OleDbDataAdapter _dataAdapter = new OleDbDataAdapter(strSelect, _connection);<br />
OleDbCommandBuilder _commandBuilder = new OleDbCommandBuilder(_dataAdapter);<br />
DataSet _dataset = new DataSet();<br />
<br />
_dataAdapter.FillSchema(_dataset, SchemaType.Source);<br />
_dataAdapter.Fill(_dataset);<br />
<br />
foreach(DataRow dr in _dataset.Tables[0].Rows)<br />
{<br />
object thisField = dr["myField"];<br />
}<br />
<br />
<br />
string myStr = "Hello World";<br />
<br />
char myChar = Convert.ToChar(0);<br />
<br />
myStr = myStr.Replace("l", myChar);<br />
<br />
Console.Writeline ( myStr );<br />
<br />
Any help would be appreciated.
Thankyou
MKeeper
"imagine how stupid the average person is ...
now imagine that half the planet is more stupid than that!"
|
|
|
|
|
There is a language called Lua. It is script writing for video games.
I want to be able to define syntax rules, compilation, intellisense, etc..
here is an example program I found
http://www.wowinterface.com/downloads/info4222-WoW_UI_Designer.html[^]
Would I make an add in to define rules for the language inside the IDE? Any links or pointers would be great.
Thanks,
Nick
1 line of code equals many bugs. So don't write any!!
-- modified at 10:47 Tuesday 23rd May, 2006
|
|
|
|