|
Hi,
I've a list view which has got 5 columns some time i'll get fill only one column and 1 row, by that time remaining columns are highlighted with square (basically selected) I want to avoid that, any chance to restrict users to select or disable one particular row in list view?
|
|
|
|
|
can i call button_click event from code
pictureclick_event()
{
//from here i want to call button clcik event with out clicking button
}
buttonclick_event()
{
}
This code was posted by me...
|
|
|
|
|
Call the button's PerformClick() method
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
tnx
m doin device application in .net
how to close a form and navigate to another form
this.close and dispose is not working
This code was posted by me...
|
|
|
|
|
Vivek Vijayan wrote: how to close a form and navigate to another form
Hi,
This code should do it:
this.Hide();
Form NewForm = new NewForm();
NewForm.ShowDialog();
I hope this helps.
|
|
|
|
|
Technically, yes, because an event handler is just a function like any other.
But - it may be better in these cases to separate out the code that would be called by multiple event handlers into its own function. Something like this:
void MyCommonFunction()
{
...
}
void PictureClick_Event(o as object, e as EventArgs)
{
MyCommonFunction();
}
void ButtonClick_Event(o as object, e as EventArgs)
{
MyCommonFunction();
}
|
|
|
|
|
|
Hi,
I think I understand your question. What you're looking for is this:
pictureclick_event()
{
MySexyButton.PerformClick();
}
// The above code will perform a Click on the button without you having to actually click it. Pretty sweet huh?
I hope this helps.
If you liked the answer I have provided, then please click the 'Good Answer' link on the bottom-right of my post.
|
|
|
|
|
How to fill a dataset using two tables coz i want to use that dataset for crystal report.
|
|
|
|
|
DataTable table1 = new DataTable();
DataTable table2 = new DataTable();
DataSet dataSet = new DataSet();
dataSet.Tables.Add(table1);
dataSet.Tables.Add(table2);
|
|
|
|
|
the code is like this..
SqlCommand cmd;
SqlConnection conn;
SqlDataAdapter sda;
conn = new SqlConnection("server=Sai2; database=Inventory; uid=sa; pwd=123456;");
cmd = conn.CreateCommand();
cmd.CommandText = "select * from stock";
sda = new SqlDataAdapter();
sda.SelectCommand = cmd;
DataS.Stock ds = new SisInventorySystem.DataS.Stock();
sda.Fill(ds, "stock");
Crystal_Reports.TotalStockRpt TtlStkRpt = new SisInventorySystem.Crystal_Reports.TotalStockRpt();
TtlStkRpt.SetDataSource(ds);
crystalReportViewer1.ReportSource = TtlStkRpt;
crystalReportViewer1.DisplayToolbar = true;
Now i have to run one more Query "select * from Company" having nothing in common between table company and stock.
|
|
|
|
|
You can write a stored procedure that returns multiple recordset and get the resultset directly mapped with a dataset, it will create the same number of datatables in your dataset as the count of resultset in your procedure...
|
|
|
|
|
DataAdapter.Fill perhaps? If you're using SQL Server for your database, you can call a stored procedure that returns two result sets - each will be filled in the dataset as a separate DataTable. The stored procedure is simple:
CREATE PROCEDURE Sample
AS
BEGIN
select * from table1;
select * from table2;
END
|
|
|
|
|
ok...
and after what to write...
da.fill(ds,"whichtable");
can i write the both table....
|
|
|
|
|
Access the tables through the DataSet's Tables collection:
DataTable dt0 = ds.Tables[0];
DataTable dt1 = ds.Tables[1];
|
|
|
|
|
Done All the things but can not Solved ...
sda.fill(ds,"Table name Is Must.")
Is there any Solution...
|
|
|
|
|
Why is the table name a must upon filling? You can always change the table name (if you really need to) after filling the set like this:
sda.Fill(ds);
ds.Tables[0].TableName = "tableNameIsAMust.";
ds.Tables[1].TableName = "somethingElse";
Or is it that you are looking to execute two queries separately (instead of together in one batch)? In that case, you could supply separate table names upon filling:
da1.Fill(ds, "Table1");
da2.Fill(ds, "Table2");
I'm having difficulty understanding exactly why this is problematic for you. Can you explain?
|
|
|
|
|
Actually I have to make a crystal report which needs two table nothing is common in between these two tables.i tried all these suggestion in this section but not working...i already posted my code...
|
|
|
|
|
With SQL Server:
"SELECT * FROM Table1 ; SELECT * FROM Table2"
(Other database engines don't allow multiple statements in a command.)
|
|
|
|
|
closin a form in application hangs the application or closes the applcn
i m doin a mobile application how can i close the form in the middle of running when a condition is met
i want to navigate to another form when a condition is met
this.close() and this.dispose is not working.
if (str.Equals("stop"))
{
//form shud be closed and navigate to another form
}
This code was posted by me...
|
|
|
|
|
Hi all...
I'm writing a program that passes on an XML file and present it on a treeView.
For some reason the application preform the task vary slow: for a 440K XML file the application needs a full minute and a half to present the tree!!, now I have a good computer and other XML readers I use read the 440K file in a second, so it's probably something I do wrong, I just don't know what.
here is the function that passes on the XML file and adds tree nodes.
private void AddNodesToTree(XmlNode currentXMLNode, TreeNode currentTreeNode)
{
if (currentXMLNode.HasChildNodes == true)
{
XmlNodeList XMLChildNodeList = currentXMLNode.ChildNodes;
XmlNode XMLChildNode;
TreeNode TreeChildNode;
int NodeIndex = 0;
for (int i = 0; i < XMLChildNodeList.Count; i++)
{
if ((XMLChildNodeList.Item(i).GetType().ToString() != "System.Xml.XmlComment") &&
(XMLChildNodeList.Item(i).GetType().ToString() != "System.Xml.XmlText"))
{
XMLChildNode = currentXMLNode.ChildNodes[i];
if (XMLChildNode.Attributes.Count != 0)
{
currentTreeNode.Nodes.Add(XMLChildNode.Attributes.Item(0).InnerText);
}
else
{
currentTreeNode.Nodes.Add(XMLChildNode.Name);
}
TreeChildNode = currentTreeNode.Nodes[NodeIndex];
NodeIndex++;
AddNodesToTree(XMLChildNode, TreeChildNode);
}
}
}
else
{
currentTreeNode.Text = (currentXMLNode.OuterXml).Trim();
}
}
Thanks, Jimmy
|
|
|
|
|
Suspend updating the display, that is your big cost. Use SuspendLayout() before you start adding nodes and then ResumeLayout(true) at the end.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
): doesn't work... still it takes a lot of time.
I've added SuspendLayout() just before I call the AddNodesToTree() for the first time, ResumeLayout(true) after that.
maybe it is the treeView?
I'm using XmlDocument to read the file and XmlNode/List.
|
|
|
|
|
Check Piebald's comments and also move the SuspendLayout() and ResumeLayout(true) outside the loop. You are still refreshing the display for EVERY node you add.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
<code>SuspendLayout()</code> and ResumeLayout(true) are out of the loop.
|
|
|
|