|
Hi all,
Why does the FolderBrowseDialog comes up Blank?
it has the buttons ok and Cancel, but does not displays the Tree view.
Thanks & Regards,
Pramod
|
|
|
|
|
I've had the same problem once. It took me quite a while to find out that this strange behaviour appears, if I select MTA (multithreaded apartment) as COM threading model. After setting it back to STA (singlethreaded apartment) the FolderBrowserDialog worked just fine. So check, if your main method looks like that:
[STAThread]
static void Main()
{
...
}
"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
|
|
|
|
|
My main function is exactly the same,but i am creating a multithreaded application, and i want to display the FolderBrowse dialog in a thread when some action is performed.
How do i do that?
Pramod
|
|
|
|
|
One more thing to notice is that if i try to open a OpenFile Dialog
that opens fine and works good,
but the File Browse Dialog does not.
Please help out...
Thanks & Regards,
Pramod
|
|
|
|
|
Hello
I am creating an application with no FormBorder, and
I want the user to be able to move the application as
if there was FormBorders. It is something similar to
Microsoft Live Messenger (In MLM you can move the window
by holding down the left mouse button)
So I want to move the application when the user holds
down the left mouse button on a picturebox.
Is there any way to do that with C#?
If so can you tell me an article which describe it,
or maybe tell me how to do it?
Thanks
QzRz
|
|
|
|
|
This can be done by handling the WM_NCHITTEST message and returning HTCAPTION when the cursor is over the picturebox. Returning HTCAPTION regardless of the cursor position will allow the user to drag your form by clicking anywhere within it.
/ravi
|
|
|
|
|
Use the Mouse Down, MouseMove and MouseUp events,
Capture the mouse oc-ordinates when the mouse is down and moving,
and set the location of the form to the mouse location (consider the offset)
i hope that works for you.
Regards,
Pramod
|
|
|
|
|
hi
how to save image into database with Datarow ? my db is sqlserver 2000 . i can insert and update value in db with Datarow but i can't save Image in db with Datarow .. how to do that ??
|
|
|
|
|
Hi
i am using .NET 1.1.
I am populating some data in DataTable using StoredProcedure.
DataTable dt = new DataTable();
DataRow dr;
DataSet ds = GetDataFromSP();
for (int k=0;k{
dr = dt.NewRow();
dr[0] = int.Parse(ds.Tables[0].Rows[k]["ID"].ToString());
dr[1] = ds.Tables[0].Rows[k]["COL1"].ToString()
dr[2] = ds.Tables[0].Rows[k]["COL2"].ToString()
dt.Rows.Add(dr);
}
//Binding to Grid using dt.
In this DataTable(dt) with same primary key multiple rows are returning by SP.
i want to check DataTable weather with this primary key is there any dupliate entry. if entry exists in DataTable, avoid the adding into the dt.
how to do this?
any sounds appriciated. awaiting for response.
regards
GV Ramana
|
|
|
|
|
Hi,
I have found som code on the Internet, which should export my datagridview to Excel. It also do that BUT it only export 4 of my 5 columns to excel (it's column number 4 it doesn't export which is Produkter.PrisExMoms from the database).
The code I use to export is:
#region Fakturalinier
int rIndex = 12;
foreach (DataRow row in dtOrdrelinier.Rows)
{
rIndex++;
int cIndex = 0;
foreach (DataColumn col in dtOrdrelinier.Columns)
{
cIndex++;
xlApp.Cells[rIndex + 1, cIndex] =
row[col.ColumnName].ToString();
}
}
}
#endregion
The code where I put the 5 columns into my datagridview:
#region FelterIDataGridView
// Databinding for the Grid
da2 = new OleDbDataAdapter("SELECT Ordre.Antal,
Ordre.VareNr, Produkter.Varenavn, Produkter.PrisExMoms FROM Produkter INNER
JOIN (Faktura INNER JOIN Ordre ON Faktura.FakturaID = Ordre.FakturaNr) ON
Produkter.VareNr = Ordre.VareNr WHERE FakturaID=@fakid", cn);
da2.SelectCommand.Parameters.Add("@fakid",
OleDbType.Integer);
da2.SelectCommand.Parameters["@fakid"].Value = fakid;
//create datatable
dtOrdrelinier = new DataTable();
//fill datatable
da2.Fill(dtOrdrelinier);
//create colum to hold the sum of other two colums
DataColumn col = new DataColumn("RaekkeBeloeb");
col.DataType = typeof(System.Decimal);
col.Expression = "Antal*PrisExMoms";
//add the colums
dtOrdrelinier.Columns.Add(col);
//bind datatable to grid view
dgrOrdre.DataSource = dtOrdrelinier;
#endregion
Anyone who can see why the column 4 (Produkter.PrisExMoms from the database) doesn't export to excel with the other columns?
Kind regards,
simsen
|
|
|
|
|
I found out, that the problem didn't was in the code, but in excel, where I had merged 2 columns together in the rows, where the datagridview should be.
I worked around the problem with the following code:
#region Fakturalinier
int rIndex = 12;
foreach (DataRow row in dtOrdrelinier.Rows)
{
rIndex++;
int cIndex = 0;
foreach (DataColumn col in dtOrdrelinier.Columns)
{
cIndex++;
if (cIndex == 4)
{
cIndex++;
}
xlApp.Cells[rIndex + 1, cIndex] = row[col.ColumnName].ToString();
}
}
#endregion
simsen
|
|
|
|
|
I want to make a mobile agent that travels from one machine to the other with data and code. the mobile agent interacts with the respective distination computer and fetch the results back to the invoking server system. how can i do that. kindly give me some example code as i am a student of MS and familiar to C# but totally new to mobile agent programming.
thanks
shah khalid
|
|
|
|
|
I want my software to be installed only after the installtion key provided by me. please tell me how can i do that.
I have developed my project in C#.net and I am using Visual Studio.net 2003.
shah khalid
|
|
|
|
|
Hi.
Is there any way that an instance can return a value (like functions do) to another instance.
Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
I think, what you want is "Property"
|
|
|
|
|
stancrm wrote: I think, what you want is "Property"
Thanks stancrm,
Tried it, but not getting required result.
Actually i'm calling Form2 from Form1 . After finishing Form2's function, a value is required from it, so that Form1 can continue its process. I think its more clear now.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
uroojkhan wrote: I think its more clear now.
Not really.
Perhaps you could chose the correct terms?
Right now one can only guess what you mean (for example "After finishing Form2's function" - are you calling a method on an instance of Form2? If so, why do you have problems returning a value from this method?)
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
mav.northwind wrote: are you calling a method on an instance of Form2?
No! calling the Form2 for entering a new record in the database. when the record is inserted there is no need to keep it. But here i need the newly iserted record's IDnumber (which is a primary key value) in the Form1, so that it can be inserted as FK in another table from Form1.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Oh boy, you should seriously start reading on OOP so that you can use the correct terms, otherwise people don't know what you're talking about.
I guess what you do is to create and show a dialog instance to perform some DB operations.
Then, when the dialog is closed and control is returned to the caller, you want the caller to be able to access some data Form2 received during the DB operations, right?
You simply have to add a publicly visible property to your Form2 class and set it's value after the insert has been performed.
Then you can query this property from the calling form.
Or you use events for this purpose if you don't want to show Form2 as a modal dialog.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Thanks mav.northwind.
The article Passing Values Between Forms (SiblingToSibling part) solved my problem.
Thanks alot for your response and
Best Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
mav.northwind wrote: You simply have to add a publicly visible property to your Form2 class and set it's value after the insert has been performed.
Then you can query this property from the calling form.
Its also working. First I tried this technique, but there was my mistake (value assignment to the property on wrong place, which yields nothing). Now its fixed.
Thanks and Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
|
|
How to open tabpage when click mouse-right button?
|
|
|
|
|
Hi all
Can anybody send me a sample code how to upload a file to VSS to a specified directory using c#???
Thanx
Akhil
|
|
|
|