|
Hi,
I have the following C# code:
Process notepad = new Process();
notepad.StartInfo.FileName = "notepad.exe";
notepad.Start();
Now the notepad process is started.
How do I execute a valid keyboard shortcut in it for e.g. "Ctrl+N", "Ctrl+O" etc.
I did not find any property to which I could assign a shortcut key, that would be executed after I start my Process.
Thanks in advance.
|
|
|
|
|
Shortcuts aren't executed, just as keypresses aren't executed. You want to SendKeys to the application. There are some examples on this site that show how to send keystrokes to another application
I are troll
|
|
|
|
|
Eddy,
But is there any way by which I would be able to capture the Handle for the shortcuts?
Also could you please mention the links, where I could find the examples you mentioned about.
Regards
|
|
|
|
|
Fatal Error provided it before I read your post, but a quick Google[^] would uncover more if you need them
I are troll
|
|
|
|
|
|
|
First off wrong forum for this
second which database you using? It looks like it has a max filed name size. try with only have the chars and see
|
|
|
|
|
myventsi wrote: but it tells me
first of all: who/what is it (a component from your runtime environment or the database) ?
I guess it's the database? I can remember that MS SQL has a pretty narrow constraint on the length of identifiers, and I don't think that other DBMS are very different in this respect. If that's the case, you have no other choice than shortening the table name (you should do that anyway...).
Regards
Thomas
www.thomas-weller.de
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. Programmer - an organism that turns coffee into software.
|
|
|
|
|
myventsi wrote: CmdStr = "CREATE TABLE " + TableName + "([abcdefghi a abcdifg abc, abcef a abcdefg ab abcdefgh abc abcdefghij] TEXT";
myventsi wrote: but it tells me that it' s too long.
What is too long? The table name or the column name? I don't think that it's the datatype that's causing trouble. Try this one for comparison;
CmdStr = "CREATE TABLE MyTableName ([MyColumName] TEXT";
I are troll
|
|
|
|
|
|
That means that this part:
[abcdefghi a abcdifg abc, abcef a abcdefg ab abcdefgh abc abcdefghij] is too long in Access' opinion. She can be like that at times
I suggest you use a shorter, more descriptive column name. What things do you want to store in there?
I are troll
|
|
|
|
|
|
LONGTEXT means that the column can hold data up to 64000 characters in length. Not that its name can be up to 64000 characters.
Several people have already told you that the column name you are using is too long. Access has told you thet the column name you are using is too long.
Why don't you believe them?
For goodness sake use a shorter column name!!!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
You can have a shorter name, it just means re-arranging the data. Create another table to hold the names of the columns give each name a column number. Whenever you need data from one of the extra long column named columns, look up it's name/number and pull data from that column of the actual data table.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
Good Afternoon All
As you know in South Africa today is a Election day, i think my ado.net code went to the Elections tooo
i have this code in my DAL
public DataSet Lis_Databases(String DB)
{
Strcon = GetConnectionString(DB);
con = new SqlConnection(Strcon);
cmdselect = new SqlCommand();
cmdselect.CommandText = "[dbo].[sp_ListDatabasesOfType_Booking]";
cmdselect.CommandType = CommandType.StoredProcedure;
cmdselect.Connection = con;
da = new SqlDataAdapter();
da.SelectCommand = cmdselect;
DataSet ds = new DataSet();
try
{
con.Open();
da.Fill(ds);
}
catch (SqlException)
{
throw;
}
finally
{
if (con != null)
{
con.Close();
}
}
return ds;
}
and i call this code in my BLL like this
public DataSet Lis_Databases(String DB)
{
DAL.DAL obj = new DAL.DAL();
DataSet ds = new DataSet();
try
{
ds = obj.Lis_Databases(DB);
}
catch (SqlException)
{
throw;
}
finally
{
obj = null;
}
return ds;
}
And call use it like this in my PL(Presention Layer)
private void List_Databases_Grid()
{
BLL.BLL obj = new BLL.BLL();
DataSet ds = new DataSet();
try
{
ds = obj.Lis_Databases(Convert.ToString(Session["ActiveDatabase"]));
if (ds.Tables[0].Rows.Count > 0)
{
GridView_Database_list.DataSource = ds;
GridView_Database_list.DataBind();
}
else
{
lblMessage.Text = "No Booking Database Avaiable,Create one";
lblMessage.Visible = true;
lblMessage.ForeColor = System.Drawing.Color.Red;
}
}
catch (SqlException ex)
{
lblMessage.Visible = true;
lblMessage.Text = "The List cannot be Binded, Please Contact ITS" + ex.Message;
lblMessage.ForeColor = System.Drawing.Color.Red;
}
finally
{
obj = null;
}
}
when my code Comes to this line
if (ds.Tables[0].Rows.Count > 0)
{
The evualuation, it passes and that mean records had been returned, now when it gets to this line
GridView_Database_list.DataSource = ds;
it says
Object reference not set to an instance of an object.
i have Initialized the Dataset everywhere as you can see above
what have i done wrong?
You can still Comment on my Error handling
Thank you
Vuyiswa Maseko
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Vuyiswa Maseko wrote: if (ds.Tables[0].Rows.Count > 0){
change that code to
if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0){
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Good Day Mbah Dhaim
I have added such a Code to Check if there any rows and your code will check if there any tables in the dataset. but my Problem is here
GridView_Database_list.DataSource = ds;
i get
Object reference not set to an instance of an object.
Error
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
OK, which object is it failing on, the gridview or the dataset?
(I don't see how it could possibly fail on the dataset though).
Is the Gridview actually in your controls collection?
Do you add it dynamically (in which case, before you add it do you actually instantiate it properly?) or is it a control in your aspx page?
And if so, if you're using frames are you not trying to access a control that is in a different frame?
Or maybe the gridview is in a content holder of and you're trying to access it from a master page?
var question = (_2b || !(_2b));
|
|
|
|
|
Thank you Greg
The GridView was inside the UpdateProgress Control
My Mistake, Thank you.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
According to your logic, ds can't be empty. I guess that you already added a watch to verify that. Let's break the statement that the compiler is complaining about into some smaller parts;
GridView_Database_list.DataSource = ds;
Could it be that "GridView_Database_list" is null? Assigning a null-value to a variable isn't likely to cause errors, but assigning a value to something that is null, probably will.
--edit--
Read Greg's post - he's right in noticing that there may be some action triggered from the Grid itself once there is an assignment to the DataSource property
I are troll
|
|
|
|
|
Thanks for your Reply
The Gridview is Clean , there is nothing Assign to it.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
DataSet is referenced type, as you see in your BLL and PL in finally part you destroy your object (DAL and BLL) : finally {obj = null} , your dataset in PL will be lost reference too.
remove finally part of your code.
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
No No the Finally Part will only Destroy the object not the Dataset, the Dataset will be Teturned Correctly. Thank you for your help i have the problem
The GridView was inside the UpdateProgress Control
My Mistake, Thank you.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Vuyiswa Maseko wrote: My Mistake, Thank you.
you're welcome
this day i learn that referenced type will not destroy although its parent destroyed.
thank you very much.
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|