|
|
hi
all
i have a form with First,Next,Prev,Buttons.
i had populated a datatable with datas .Now i need to navigate through the records , can any body help me how to achieve this.
conn = new SqlConnection(connstr);<br />
conn.Open();<br />
SqlCommand cmd = new SqlCommand(sqlAllCustomers, conn);<br />
SqlDataAdapter adpt = new SqlDataAdapter(cmd);<br />
DataTable dtCust1 = new DataTable("CustomerDatTab");<br />
adpt.Fill(dtCust1);
thanks
senthil
|
|
|
|
|
dtCust1.Rows[index]["columnName"]
SkyWalker
|
|
|
|
|
This might not be the best of the methods but I use to do like that
dtCust1.Rows[i][columnName] --> this will give you the value in the datatable for the row "i" and column "columnName".
Now for the next record increment the value of "i" by one, for previous record decrement the value of "i" by one, for First record set the value of "i" to 0 and for Last record set the value of "i" to dtCust1.Rows.Count.
Hope this helps.
Regards
|
|
|
|
|
hi aamir
i too did so , its working .
Thank u for responding me.
kssk
senthil
|
|
|
|
|
You could use either:
for (int i = 0; i < dtCust1.Rows.Count; i++)
{
DataRow row = dtCust.Rows[i];
Console.WriteLine(row[0]);
} or
foreach (DataRow row in dtCust1.Rows)
{
Console.WriteLine(row[0]);
}
|
|
|
|
|
how to call stored procedure developed in sql server 2005 in rdlc reports using C#.
|
|
|
|
|
Try googling it.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Helpful, intelligent answer. Google directed me here when googling it..
|
|
|
|
|
Hi,
I have given subquery like this..
SELECT DISTINCT product1, product2, product3, product4
FROM onlinegoa2
WHERE (product4 IN
(SELECT DISTINCT product4
FROM onlinegoa2 AS onlinegoa2_1)) OR
(product3 IN
(SELECT DISTINCT onlinegoa2.product3
FROM onlinegoa3)) OR
(product4 IN
(SELECT DISTINCT product4
FROM onlinegoa2 AS onlinegoa2_2))
Its working fine, but i have to get the distinct value of product1 to product4...
krishna
|
|
|
|
|
Did you get this to work yet?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
HI,
I have given the sub query like this....
SELECT DISTINCT product1 FROM onlinegoa2 WHERE(product2 IN(SELECT DISTINCT product2 FROM onlinegoa2 AS onlinegoa2_1)) OR (product3 IN (SELECT DISTINCT onlinegoa2.product3 FROM onlinegoa3)) OR (product4 IN (SELECT DISTINCT product4 FROM onlinegoa2 AS onlinegoa2_2))
Its working but iam getting the output data's only from product1 and product2....i has to display up to product10....can u pls help me display all the product columns.
krishna
|
|
|
|
|
Did you get this to work yet?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Hi all,
I'm new to .NET environment. I wrote an assembly in C#. This will take the Handle of the form from the client application and sets the form of this assembly as child to the Client application form.
When i send the parent handle from the .NET client the form in the assembly appears as child form. But when i send the parent handle from the COM comaptible language(VB6 or VC++) forms,it doesn't appear as child instead it appears outside of the form.
My code is
<u>In MyAssembly.dll</u>
public bool Create(long hwndParent)
{
ChildForm f = new ChildForm(); // object for the Form present in the Assembly
f.TopLevel = false;
f.Parent = Form.FromHandle((IntPtr)hwndParent);
f.Show();
return true;
}
<u>From VC++ Client</u>
{
IFramePtr pChildFrame; //Object for the Assembly
HRESULT hr = pChildFrame.CreateInstance(__uuidof(CFrame));
if(FAILED(hr))
{
AfxMessageBox(_T("Failed"));
}
pChildFrame->Create((long)this->m_hWnd);
}
Can any one please help me
Thanks in advance
|
|
|
|
|
Did you get this to work yet?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Hi,
I need to create a WebSite in Sharepoint 2007 by programatically using Web Services. After creating a WebSite I need to Create a Document Library. I need to upload files to this Document Library too. All these I need to do using Web Services (using Sharepoint Web Services only). Can you please help me ?
Expecting your early reply
Regards
Mohamed Nazeem
Software Engineer
Bangalore
|
|
|
|
|
Friends,
i need some sample questions those can solve by using control structures in c#.
i expect this progams should give indepth knowledge about the control structures in C#..
|
|
|
|
|
What do you mean by control structures ? Do you mean things like if/else and switch ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
yup the same
self confidence+hard work=SUCCESS
|
|
|
|
|
Why did your username change ?
Buy a book, that's ground level stuff, if you don't know it, you should be buying a book anyhow.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hope u din get my question
actually i need some sample questions those can be don by control structures.....
if anyone do this program thy should hv more knowledge abt that ctrl structure....
i need to make test to my staffs so i asked,,
self confidence+hard work=SUCCESS
|
|
|
|
|
Murali.S wrote: i need to make test to my staffs so i asked,,
Check out http://www.questpond.com/[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
hi all
good morning.can anyone tell me how to apply styles to a grid control.
i want a design like this.
i have a grid control in which the header should be displayed in a different style and the contents in another style.(i have tried applying styles through stylesheet but it is not working with grid.)how to set the style only for the header in the grid.
i have set the paging property of the grid.i want to display in the footer of the grid as follows.
"Records: 1 to 10 of 25 - Pages: 1|2|3"
pintoo
|
|
|
|
|
I have a C# class library (MyInterop.dll) with interface method for COM Interop. I have VC++ app which will load the C# library and invoke the methods at run time.
I know that if i use #import (MyInterop.dll) and then CreateInstance() to invoke the interface method it works. But my requirement is to load the dll at run time. hence i cannot use #import()
VC++ program will know only the dll name. Based on the DLL name i tried to use LoadTypeLib(), GetTypeAttr() to get the CLSID. And then based on the CLSID i want to create an IDispatch instance
CoLoadLibrary(), GetProcAddress(), ClassFactory(),
CreateInstance(, IID_IDispatch, &m_dispatch)
The call to LoadTypeLib("MyInterop.dll") returns Error loading type library/DLL
Please help
Thank you
|
|
|
|
|
Hi,
Is it possible to create user-defined controls (.ascx file) and use them in windows applications. If so can anyone provide links, resources.
Thanks and Rgds,
PLS
Long Live
|
|
|
|