|
As u say 'It may have focus but if it is customly drawn it's proboble that it just doesn't change (visual side) when recieved focus.'
here I am losing the focus that means I am not able to get the fous on any control after the third party grid when I tab out
Regards,
Sivaprasad
|
|
|
|
|
first u told that u are not able to focus the grid, resp. first cell on the grid. now u telling that u are not able to pass focus further from the grid ? U cannot loose focus. It just somewhere (probobly on the grid and it is not displayed). But u haven't answered my question. Do you have source code?
|
|
|
|
|
I told that I am not able to focus on the grid, WHICH IS MY PROBLEM.
But u told that focus will be ther but we cant viwe it ...thatz y I told that if focus is there and we cant view it the focus should atleast pass to the next control after the grid when I tab out rite??
I hope u understood my probl;em
No I dont have the source code.
Regards,
Sivaprasad
|
|
|
|
|
Now I understand . Generally speaking if your grid is derived from System.Windows.Forms.Control, it can recieve focus. If that control has focus and tab is pressed, any child controls inside will be focused. After last child control is focused, focus is passed to another control (on same level as your datagrid). If your Datagrid is derived from System.Windows.Forms.UserControl, it won't recieve focus, only it's children. This is default behaviout which can be changed and it's really hard to help you if u cannot change the source code.
There is one thing u can do. U can hook on GotFocus event of your datagrid. Whenn triggered, try to browse child controls of that grid and focus first one(or maybe first one of type TextBox) . But that may not work at all, depends on implementation of that datagrid...
hope that helps...
|
|
|
|
|
Hello all,
I have created an sql database, programatically.
i have one table in it, which again has been created.
At the end, I want to delete the databse, hence I use the sql command
DROP DATABASE databasename
I get an exception saying it is being used.
I have also tried deleting table before that.
Could someone help me.
thanks in advance.
Keshav Kamat
India
|
|
|
|
|
The problem that you have is that when you connect from a language such as C#, the connection string includes a database to connect to. Now, this means that you are logged in against this database, and consequently can't drop it because you have an active connection to the database.
The way round this is to close that connection, and then create a new connection to a different database on the server (say MASTER), and drop the database from there.
Why are you trying to do this though? Try as I might, I can't think of a valid business reason you would want to do this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I got it how to do.
The reason why i was unable to drop the database was because it had dependencies with the default system tables whenever it was created. so i had to roll back the changes and the dependencies, after which i was able to drop it.
BTW, I didnt choose the database name in the connection. the initial catalog was left blank.
here is how.
SqlConnection connDeleteDatabase = new SqlConnection("Data Source=" + Environment.MachineName + "\\WINCC;Integrated Security=SSPI;Initial Catalog=; Packet Size = 32766;");
try
{
connDeleteDatabase.Open();
SqlCommand cmdDeleteDatabase = new SqlCommand("ALTER DATABASE Logger SET SINGLE_USER WITH ROLLBACK IMMEDIATE", connDeleteDatabase);
cmdDeleteDatabase.ExecuteNonQuery();
cmdDeleteDatabase = new SqlCommand("DROP DATABASE Logger", connDeleteDatabase);
cmdDeleteDatabase.ExecuteNonQuery();
}
catch (System.Exception exception)
{
MessageBox.Show(exception.Message);
}
finally
{
if (connDeleteDatabase.State == ConnectionState.Open)
connDeleteDatabase.Close();
}
thanks anyways.
Keshav Kamat
India
|
|
|
|
|
Hello all,
I have the following problem. I have 2 applications in c#, Application1 send some information to Application2 using a TCP connection. I have done everything
* On my server side
ChannelServices.RegisterChannel(...);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(someRemoteObject), "someName", WellKnownObjectMode.Singleton);
* On my client side
ChannelServices.RegisterChannel(...);
sO = (someObject)Activator.GetObject(typeof(someRemoteObject), "...");
sO.callSomeMethodonServer();
The communication works, and I can retrieve the information from Application1 in Application2. The problem comes when I start sending the information from Application1 several times, after sending and receiving the messages "xxx" times the following starts to happen
1. Application1 sends the message
2. Application2 doesn't receive the message
3. Application1 freezes
4. Application2 starts consuming half of my cpu, and sometimes even more!!!
Any clues?? I'd really appreciate it
Regards, David
P.S If it helps I'm using .NET 1.1, VS2003, and windowsXP SP2
|
|
|
|
|
Hi,
Can u help me with displaying form's default context menu (Restore, Move, Size, Minimize, Maximize, Close items) programaticly ? I've custom non-client area and somehow that menu is not appearing when rightclicked on it. thanx
|
|
|
|
|
I want to access a variable and get its value.This variable was created in old form which is called. And now I'm being a new form. Pleased show me!
Thank you!
|
|
|
|
|
dont create the variable in the form load event.
create a separate class in the namespace of the old form
once you have done that, u can use the variable using the classname and the dot operator.
as classname.variable name
like, mySeparateClass.globalVariable1
Keshav Kamat
India
|
|
|
|
|
One metod is to create a new metod to show the new form.
public void myshow(object param)
{
this.Show();
this.param=param;
}
|
|
|
|
|
you can access that variable in any form, using the class name
Keshav Kamat
India
|
|
|
|
|
Keshav V. Kamat wrote: you can access that variable in any form, using the class name
No. You can't. He described an instance field. Not a static field.
|
|
|
|
|
Overload default constructor of the new form and pass the old form object to this constructor. Use that object to access the value
|
|
|
|
|
Can you can show me more clearly? May be give me some code? I'm a beginner. Thank you very much!
|
|
|
|
|
namespace Sample
{
public partial class Form1 : Form
{
}
// create a separate class here
public class mySeparateClass
{
public static int globalVariable=new int();
}
}
Once you have done that, u can access the variable globalVariable, anywhere in all the forms of the project using the classname as follows.
mySeparateClass.globalVariable
try it.;)
Keshav Kamat
India
|
|
|
|
|
Global variables are generally an indication of a poor design. If you feel compelled to use a global variable your first thoughts should be: Is there a better way to do this? If not, then fine, use the global variable. But they should not be your first option.
|
|
|
|
|
|
Please show me how to creat a variable that can use in all form in my project.I'm learning C#.NET 2005.
|
|
|
|
|
create a separate class like below
public class mySeparateClass
{
public static int globalVariable1 = new int();
}
then you can use the variable globalVariable1 as mySeparateClass.globalVariable.
check it out.
i hope this works.
Keshav Kamat
India
|
|
|
|
|
Declare a variable as static
public static int myvar=1;
|
|
|
|
|
Hi
We create application which was used webdav method
using this we fetch mails from exchange server for a particular mail id (like xxx@uuu.com)
We fetch Inbox Mails and Sent Items folder mails and insert into two tables (sql server)
My problem is, I want relate to Inbox Mail and Sent Item Mail
If One mail is come from in my inbox
say like "New Mail.EML"
when i reply to "New Mail.EML"
it stored in sent items folder as "RE:New Mail.EML"
i want how to find relationsship between NewMail and RE:NewMail
Which Property in webdav method , to determine this relationship
Expecting Earlier answer
By
Arun
|
|
|
|
|
I have create one xml from one dataTable.
DataTable dt=new DataTabel();
.................
oleDbCommand1.CommandText = "SELECT * From ss";
adapt = new OleDbDataAdapter(oleDbCommand1);
...............
adapt.Fill(dt, "one");
dt.WriteXml("dei.xml");
the xml is like this:
<one>
<unu> string <\unu>
<\one>
<one>
<unu> double <\unu>
<\one>
<one>
<unu> float <\unu>
<\one>
i need to create :
<one>
<unu> string <\unu>
<unu> double <\unu>
<unu> float <\unu>
<\one>
-- modified at 4:54 Wednesday 14th March, 2007
|
|
|
|
|
Add this datatable to a dataset names one. Then use dataste writexml method..
I am not sure..It's a wild guess
|
|
|
|