|
Mark Nischalke wrote:
Just because you can wear something doesn't mean you should
I thought I was far enough from my wife.
|
|
|
|
|
In this case if it is correct and valid then I don't mind it - i just need to know if it's correct and valid.
|
|
|
|
|
I don't have my compiler open, but that should work. The lambda type will get the delegate type inferred by the compiler and will get assigned as a delegate instance to DoStuff. "bar" will then be captured and then assigned null. Not sure what you're trying to accomplish, but that code should run fine without any compilation errors or runtime errors.
|
|
|
|
|
Essentially I was thinking of using it within BackgroundWorker.RunWorkerCompleted - I wanted to put in a call to CommandManager.InvalidateRequerySuggested - one of the commands in its CanExecute method tests if the worker is null.
|
|
|
|
|
I have a dgv that's bound to a table tblQuoteItems.
One of the columns of the dgv is ItemID which is a combobox column.
Its value is obtained from ItemID field of tblQuoteItems.
Before binding the dgv, the ItemID column is populated from
tblItems table containing fields ItemID and Item.
The ItemID column of the dgv has ItemID as valuemember and Item as
displaymember.
Now is it possible to rebind only the ItemID column while keeping the
dgv state intact i.e. without rebinding the dgv?
For example I open up a lookup form and modify tblItems table,
then I want the effect to be acted upon the ItemID column of the dgv
without affecting the state of the dgv.
I recalled BindDGVComboBox method defined underneath after modifying
the values of tblItems but of no avail. Please help.
My code follows:
SqlConnection con;
string strSql;
SqlDataAdapter da;
DataTable dt;
SqlCommandBuilder cb;
BindingSource bs = null;
void PopulateDgv()
{
LineID = new DataGridViewTextBoxColumn();
QuoteID = new DataGridViewTextBoxColumn();
ItemID = new DataGridViewComboBoxColumn();
LookupItems = new DataGridViewButtonColumn();
Quantity = new DataGridViewTextBoxColumn();
UnitPrice = new DataGridViewTextBoxColumn();
LineTotal = new DataGridViewTextBoxColumn();
dgvItems.Columns.Clear();
dgvItems.DataSource = null;
dgvItems.Columns.AddRange(new DataGridViewColumn[] {LineID, QuoteID, ItemID, LookupItems, Quantity, UnitPrice, LineTotal });
LineID.Name = "LineID";
LineID.DataPropertyName = "LineID";
LineID.Visible = false;
QuoteID.Name = "QuoteID";
QuoteID.DataPropertyName = "QuoteID";
QuoteID.Visible = false;
ItemID.Name = "ItemID";
ItemID.DataPropertyName = "ItemID";
LookupItems.Name = "LookupItems";
LookupItems.DataPropertyName = "LookupItems";
LookupItems.DefaultCellStyle.NullValue = "...";
LookupItems.Resizable = DataGridViewTriState.False;
Quantity.Name = "Quantity";
Quantity.DataPropertyName = "Quantity";
UnitPrice.Name = "UnitPrice";
UnitPrice.DataPropertyName = "UnitPrice";
LineTotal.Name = "LineTotal";
LineTotal.DataPropertyName = "LineTotal";
LineTotal.ReadOnly = true;
BindDGVComboBox(ItemID, "Select ItemID,Item From tblShopItems Order By ItemID", "ItemID", "Item");
if (bs == null) { bs = new BindingSource(); }
if (dt == null) { dt = new DataTable(); }
strSql = "Select LineID,QuoteID,ItemID,'...' As LookupItems,Quantity,UnitPrice,LineTotal From tblShopQuotesItems Where QuoteID=" + Globals.Val(Tag);
da = CreateDataAdapter(strSql);
cb = new SqlCommandBuilder(da);
dt.Locale = System.Globalization.CultureInfo.InvariantCulture;
dt.Clear();
da.Fill(dt);
bs.DataSource = dt;
dgvItems.DataSource = bs;
}
void BindDGVComboBox(DataGridViewComboBoxColumn objComboBox, string strQuery, string strValueMember, string strDisplayMember)
{
DataSet ds = new DataSet();
ds = CreateDataSet(strQuery);
DataView dv = ds.Tables["dtDataTable"].DefaultView;
objComboBox.DataSource = null;
objComboBox.DataSource = dv;
if (strValueMember != null) { objComboBox.ValueMember = strValueMember; }
objComboBox.DisplayMember = strDisplayMember;
}
DataSet CreateDataSet(string strQuery)
{
DataSet ds = new DataSet();
SqlDataAdapter da = CreateDataAdapter(strQuery);
SqlCommandBuilder cb = new SqlCommandBuilder(da);
da.Fill(ds, "dtDataTable");
return ds;
}
SqlDataAdapter CreateDataAdapter(string strQuery)
{
SetConnection();
SqlDataAdapter daAdapter = new SqlDataAdapter(strQuery, con);
CloseConnection();
return daAdapter;
}
void SetConnection()
{
if (con == null) { con = new SqlConnection(GetConnectionString()); }
if (con.State == ConnectionState.Closed) { con.Open(); }
}
string GetConnectionString()
{
string strConn;
strConn = "Persist Security Info=False;User ID=sa;Password=;Initial Catalog=TestDB;Data Source=MyServer";
return strConn;
}
|
|
|
|
|
Hi All,
My requirement is to capture all the Sql server logins.Is it possible to capture through DOT NET?.Please Suggest me if any option available.
Thanks in advance
MEK
|
|
|
|
|
You should be able to get the login names from one of the systems tables I believe; however you will not be able to get the passwords. What is your reasoning for this? I think most here will be very suspicious of such a request.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Actually i want to keep track of all the user name and password in any file or what ever?
so that it can get the password changed when ever I've changed my password in Sql server.
I do not want store the password.Just i want access it.
Is Is possible?
thanks once again..
|
|
|
|
|
IMO there is no reason for this and you will not recieve any assistance here to hack user accounts.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
ksss_maheshece wrote: Is Is possible?
Is it possible to see the password on the SQL Server side? No.
|
|
|
|
|
The server is protected with a password.
Your door is locked with a key.
If you could simply get the password, what use would the lock have? The simple solution would be to not lock your door at all.
I are Troll
|
|
|
|
|
Hi forum
I have in my application a usercontrol (created by me) which is a circle. This circle is moving all time around the form.
into the form have too a series of blocks. When the circle touches this block have to change the direction.
My problem that i don't know how to detect the edge of the circle is touching another object.
At this momento im working with the central point of the circle, but I want to detect not only that point, i need to detect the entire border.
how can i do it???
Thankyou
|
|
|
|
|
Isn't the edge just the central point plus the radius? If the central point is radius distance from any square then it is touching.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Yes i know that. but i was thinking in do it with the location of each point of the edge.
I was thinking that c# had functions for this purpose.
Thankyou
|
|
|
|
|
Hi,
this is one approach:
- consider the square surrounding your circle;
- as a first filter, detect touch/overlap between this square and each object of interest;
- for refinement, when a touch/overlap is found, calculate the distance between the relevant points of the object and the center of the circle. When all of them are greater than the radius, it was a false positive.
|
|
|
|
|
If the blocks are composed of completely vertical and completely horizontal edges, this is easy. For horizontal edges, the edge of the circle closest to that edge will always be on the vertical line that intersects the circle's center. For vertical edges, the edge of the circle closest to that edge will always be on the horizontal line that intersects the circle's center. Compare the distance between the circle's center and the line edges to determine if the circle is inside the block.
If the blocks can be rotated, that makes it only slightly more complex. You can use the equation, y = mx + b (slope intercept form, if memory serves), to create an equation from two points on each edge (perfectly vertical lines being the exception)... you get those points from the block corners. From that equation, you can create a perpendicular line by inverting the slope and using the circle's center as one of the points that the perpendicular line passes through. Intersect the perpendicular line with the edge to determine where they meet. Use that point and the center of the circle to determine how far away the circle is from that edge. You can use that information to determine if the circle is inside the block.
There are also edge cases to check for. Make sure to detect if the center of the circle is inside the block (sounds like you already know how to do that). And you'll want to make sure to correctly check if the circle is on the corner of a block (easily checked for by comparing the circle radius to the distance between the center of the circle and the edges of the block).
|
|
|
|
|
hello!!
i want to retrieve text from word file and copy to another word file.
but resultant shows garbage value.
please guide me.
thanx
|
|
|
|
|
You will need to use the Office Interop[^] classes to access Office objects.
It's time for a new signature.
|
|
|
|
|
annie_bel wrote: but resultant shows garbage value.
That's because the file is in RTF format: read this[^].
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Hi,
I'm using visual studio 2010.
And when i run the project on debug mode from the visual studio - and some exception is appear i see strange message box that tell me that some exception appear ( the message is "external exception e043..." ).
I cant see the line in the code that make the problem and i don't know in this way what i need to fix in the code.
I think this is something with my debug option - but i don't know how to fix/solve it.
The try...catch block does not help - and this message appear in any case.
I also heve problem to kill the process thru the task manager on some cases
Someone can help here ?
Thanks.
P.S: how can i add screenshot to my new message ?
|
|
|
|
|
You will need to step through the code, one line at a time until it blows up. Do you have an idea of where it might be falling apart? Is there a point in the process of the app that it all starts to go wrong? Start from there.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
In the pass ( visual studio 2008/2005 ) when i run on debug mode - i could see that the code stop and the IDE show me the line that cause the exception.
This is what i want to see in the visual studio 2010 ...
Step into the code using step by step is something that can take a lot of time.
|
|
|
|
|
Yanshof wrote: In the pass ( visual studio 2008/2005 ) when i run on debug mode - i could see that the code stop and the IDE show me the line that cause the exception.This is what i want to see in the visual studio 2010 ...
This is not completely correct, because the IDE only switches to the line if the exception is not caught anywhere (or you changed the settings under Debug->Exceptions).
I do not have much experience with VS2010 but I think it behaves the same.
I think your problem is, that somewhere this exception gets caught and a message box is displayed.
Greetings
Covean
|
|
|
|
|
As digital_man said, single step is one way to find it. The other is: on the VS Menu bar, "Debug...Exceptions..." tick every single box on the resulting dialog, press OK.
Now VS will trap exceptions for everything, whether they are handled or not. This is a right PITA so you will want to reset them when you have found the problem, but sometimes it is teh only way to find a proper c**k-up.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Hi,
I wish to create an unattended automated installation for MSMQ component with no http support for both of the mentioned OS.
As i have never done this before, kindly if anyone can help, i will be most thankful.
|
|
|
|