|
Hello,
~~~Johnny~~~ wrote: I tired different things like adding
dataGrid.Scroll -= new ScrollEventHandler(dataGrid_Scroll);
dataGrid.KeyPress -= new KeyPressEventHandler(dataGrid_KeyPress);
beofre assigning dataGrid to the new FinderDataGridView object but stil doesn't work.
Although, it is not solving your problem, you should always unregister the event like this, bevor creating a new instance, cause the old instance will not be cleared by the GC.
I think the problem could be that you are not removing the old dataGrid instance out of the datagridSplit.Panel2.Controls.
If your dataGrid instance has a dispose method, you also should call it.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Question to anyone please. Is SQl Server express Edition read only from an application. Insert and Update doesn't work. I cannot find the answers anywhere.
thx
Nana
|
|
|
|
|
Agyeman wrote: Is SQl Server express Edition read only from an application
That woiuld make it pretty useless as a desktop database, wouldn't it?
Agyeman wrote: Insert and Update doesn't work
The problem is most assuredly with your code. It would help if you posted a segment of the code you're using to try and update the database.
|
|
|
|
|
Dave Kreskowiak wrote: That would make it pretty useless as a desktop database
No kidding
|
|
|
|
|
There is no difference between SQL server 2005 and SQL 2005 Express except for certain limitations in the database size and features. Other than that iit is a fully implemented SQL database
|
|
|
|
|
Agyeman wrote: Is SQl Server express Edition read only from an application
No. You can read and write with it.
Agyeman wrote: Insert and Update doesn't work
Like Dave said, problem may be in your SQL statement, go ahead and post your Insert and Update that aren't working...
|
|
|
|
|
sql server express edition is only made ready only if that is what your users rights have been defined as. You can set up your user rights anyway you want. Normally you should control access to your tables through stored procedures. So one stored procedure to read data from the table, a different stored procedure to insert, another stored procedure to update, finally a stored procedure to delete.
Ben
|
|
|
|
|
If I'm guessing right, you most probably have a buggy code that inserts/updates (or) the folder in which the database file (.mdf) is located is readonly.
If your database file is located in someplace other than the default SQL Server installation path, check the folder and file permissions.
This is a common issue in using the Express edition in ASP.NET for user management. So maybe you're stuck somewhere similar.
SG
|
|
|
|
|
I have a string array.
Say i am looking at strArray[10]
I would like to find out how many chars are in array element 10.
I tried the .Length method but that does not seem to work.
What would giv eme this result?
|
|
|
|
|
strArray[10].Length is what you want.
|
|
|
|
|
That does not seem to work for me.
I have some text say "THIS IS A GREAT DAY" in location strArray[10]
I would like to get DAY out of there so i grab the length, then use it in the substring function, to extract the last three chars from the last position.
This blows up
|
|
|
|
|
|
The length value that i get back is bigger than the scope for that element.
|
|
|
|
|
This works fine:
string[] test = new string[] {
"Hello World!",
"This is a great day"
};
MessageBox.Show(test[1].Substring(test[1].Length - 3, 3));
|
|
|
|
|
LCI wrote: this blows up
string test = "THIS IS A GREAT DAY";
string day = test.Substring(test.IndexOf("DAY"), 3);
That works just fine here.
|
|
|
|
|
That works fine provided that the string is constant. What i am attempting to accomplish is to get the last 3 chars no matter what.
So i do something like
end = strArray[10].Length;
string strText = strArray[10].SubString((end-3), 3);
The end value seems to be bigger than the scope for strArray[10]
|
|
|
|
|
LCI wrote: What i am attempting to accomplish is to get the last 3 chars no matter what.
What if it is shorter then 3?
Remember that in string indexing starts from zero.
|
|
|
|
|
Remember that character indexes are 0 based, where the length counting starts at 1. To give an example, the string "day" has a length of 3 right? But the last character index is 2, not 3! The reason is that character index is 0, so [0] is d, [1] is a, [2] is y.
if (strArray[10].Length >= 3)
{
int lastCharacterIndex = strArray.Length - 1;
string strText = strArray[10].SubString(lastCharacterIndex - 3, 3);
}
|
|
|
|
|
|
It is 85501rrA backwards.
led mike
|
|
|
|
|
|
|
"If Google can't find it, it doesn't exist"
|
|
|
|
|
That's what I thought
|
|
|
|
|
Maybe so, but Google knows about "Arr 10558" ...
|
|
|
|