|
how do i get the path of an open file in windows using c#.
I want to get the path of the word documents which are currently open.
note that the documents are not opened through any application.
Any ideas..
Luck is Opportunity with hardwork
|
|
|
|
|
hi,
I dont know ecxactly but I think you should look in the direction of "process"
May be you can get some idea from there,I am not sure but you can try that out.
<marquee>nishu
|
|
|
|
|
Hi thanks for the reply...
Ofcourse i have an instance for all the processes which are currently running in my system ,But i have to get the path of that process...
Is it possible...?
Luck is Opportunity with hardwork
|
|
|
|
|
Hi
I got 2 user controls in a page. In 1.ascx, I got a datagrid which contains a button for each value. If I click a button, the textboxes in another user control 2.ascx should be set according to the button value.
Can I do this in just button_click event?
|
|
|
|
|
This is some sort of problem created by myself, and the thing is I am not able to find out why the the event datagridview1_rowvaliditing event is not being fired when I leave my customized datagridview.
Whenever I add a new row in datagridview and click on a button outside the grid the rowvalidating event should fire so that row goes into the binded datatable of the grid. But this event does not fire and my added row does not go into datasourcetable and hence I am not able to save the added row to database.
The workaround is that if I add a new row and move to some other row then this event fires and datatable gets updated.
Ideally, this row should get added as soon as I leave the grid, and rowvaliditing event should be fired, but I do not know what is the reason that thing does not occur.
I know I have made some mistake somewhere but I am not able to figure it out.
Someone please help. Thanks in advance.
Thanks,
RajKat
|
|
|
|
|
This is some sort of problem created by myself, and the thing is I am not able to find out why the color of a datagridviewcell is not changing to the color that I give.
I am using :
datagridview1.Rows(0).Cells(0).Style.BackColor = Color.Orange
But this does not work.
A normal datagridview allows this to work. I know I have made some mistake somewhere but I am not able to figure it out.
Some please help. Thanks in advance.
Thanks,
RajKat
|
|
|
|
|
RajKat wrote: datagridview1.Rows(0).Cells(0).Style.BackColor = Color.Orange
Try brackets rather than parenthesis:
datagridView1.Rows[0].Cells[0].Style.BackColor=Color.Orange;
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I have an application written in C# with SQL server Dbase . Would like to convert the same application to Web Enabled as ASP.NET without having to Re-write the code again in ASP.NET . Can anyone help in that ?
UnitecSoft
We will Either Find A Way , Or We Will Make One .
|
|
|
|
|
If you designed it properly then all you need to to is slap on a different UI - All your business logic and database interaction should be separate from your UI.
|
|
|
|
|
unitecsoft wrote: I have an application written in C# with SQL server Dbase . Would like to convert the same application to Web Enabled as ASP.NET without having to Re-write the code again in ASP.NET . Can anyone help in that ?
Your question is a little broad and doesn't provide a lot of information about the design of your current app. As Colin says, if your app has been designed well and seperates UI, Data Access and Business logic then it should be a fairly straight forward job to replace the existing UI with a web front end. (Although that depends on the complexity of the UI as the stateless nature of HTTP can make it hard to convert a WinForm to a WebForm directly)
|
|
|
|
|
Basically, there is no tool to convert a Windows Forms app to an ASP.NET app. The ways each work with it's own forms are so different, a direct translation is not possible. You're stuck re-writing your application.
But, as Colin said, if your application was written properly, meaning that you kept your business and data logic in classes seperate from your application code, you've minimized the work you have to do rewriting your UI code. Properly written Business Logic and Data Access layers will be completely independant of the User Interface code. This way, you only need to write a new UI layer if you want to support multiple types of clients, like Windows Forms, ASP.NET, Pocket PC's, mini browsers (cell phones), or Embedded systems.
Google for "3-Tier" and "n-tier" application development and you'll find TONS of resources on how to properly write applications that support this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How to convert Int to DateTime and vice versa?
Thanks and Regards
Madhu
|
|
|
|
|
Depends on how the DateTime is represented in the int.
|
|
|
|
|
Hello
What's the format of the integer? Is it YYYDDMM, days, monthes, weeks???
Regards
|
|
|
|
|
Can anybody tell me something about Microsoft Code Blocks?
kumar
(Beginner)
|
|
|
|
|
|
Whoa! It's all in sanscript/Arabic, and it's right-to-left!
|
|
|
|
|
kumar.bs wrote: Can anybody tell me something about Microsoft Code Blocks?
Do you mean application blocks[^]?
What do you want to know?
As the site says
Application Blocks are reusable source-code components that provide proven solutions to common development challenges. They can be integrated as is into applications, or they can be extended or customized. patterns & practices Application Blocks address specific recurring problem domains such as data access, logging, user interface process, and composite user interfaces.
|
|
|
|
|
Hi,
I am trying to run a select query on a datatable.
The datatable holds information I get from an Access database.
My code:
<br />
OleDbConnection myConn = new OleDbConnection();<br />
myConn.ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0;data source=" + DBPath;<br />
<br />
OleDbCommand myCommand = new OleDbCommand();<br />
myCommand.Connection = myConn;<br />
myCommand.CommandText = "Select * from [tblMembers] where Active = false";<br />
myCommand.CommandType = System.Data.CommandType.Text;<br />
System.Data.DataTable myTable = new System.Data.DataTable("myTable");<br />
<br />
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(myCommand);<br />
myDataAdapter.Fill(myTable);
I have to query three columns in the datatable (MemberID, MemberLanguage, MemberName), and bind those info to the following variables:
intMemberID, strMemberLanguage, strMemberName
How can I do this?
|
|
|
|
|
Hello
You can do that using OleDbCommand.ExecuteReader() that will return a DataReader object. Using it you can get your results.
About the columns selection, then you sould modify your SELECT statement. Binding them to these three variables is quite unclear. Data binding is done with bindable controls, not variables.
Regards
|
|
|
|
|
Nothing wrong with using the DataTable he has. The DataReader is a connected object which may not be optimal for the situation.
only two letters away from being an asset
|
|
|
|
|
Nader Elshehabi wrote: You can do that using OleDbCommand.ExecuteReader() that will return a DataReader object. Using it you can get your results.
About the columns selection, then you sould modify your SELECT statement. Binding them to these three variables is quite unclear. Data binding is done with bindable controls, not variables.
This is not really what I wanted, I already have the info in the datatable, I just need to query it, using some sort of select statement, where I can select the current row that has the values I need, and bind those values to variables.
|
|
|
|
|
intMemberID = Convert.ToInt32(myTable.Row[0]["MemberID"]); ...
only two letters away from being an asset
|
|
|
|
|
I'd be extremely surprised if that's what he was asking about?!! I had all sorts of guesses jumping in my mind of what really he was asking about. A guy who makes an SqlConnection didn't know how to convert a string to Int32?!!
Regards
|
|
|
|
|
Nader Elshehabi wrote: I'd be extremely surprised if that's what he was asking about?!! I had all sorts of guesses jumping in my mind of what really he was asking about. A guy who makes an SqlConnection didn't know how to convert a string to Int32?!!
I am not sure if you were talking of my message, but what I meant was. I have a datatable, already filled with information from the database. Now I need to use some of the data in that datatable, bind to a variable I can use throughout my application. I am building the app as a windows app.
The problem is, I have a MemberID(it's unique and primary key), that I need to use to get the member's language and name from the datatable. So I wanted to do something like
SELECT MemberID, MemberLanguage, MemberName FROM "mytable" where MemberID = strCurrentMemberID<br />
'mytable = the datatable
I dont know how to do this select from a datatable.
|
|
|
|