|
you are welcome
|
|
|
|
|
hello ,
i want to export data from datagrid to excel sheet iam getting one error,
error:
Control 'DataGrid1__ctl3__ctl0' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server.
iam getting error at this line
DataGrid1.RenderControl(htmlWrite);
please give me any advice
srinivas
|
|
|
|
|
Hi,
Hope this code help
private void button1_Click(object sender, System.EventArgs e)
{
SaveFileDialog SD= new SaveFileDialog();
SD.Filter = "csv|*.csv|Comma Seperated Files|*.csv|All Files|*.*";
SD.InitialDirectory = @"C:\";
if (SD.ShowDialog() == DialogResult.OK)
{
using (System.IO.StreamWriter writer = new System.IO.StreamWriter(SD.FileName))
{
int Colcnt = dsResults.Tables["tbl_Master_Pol_Lst"].Columns.Count;
int Rowcnt = dsResults.Tables ["tbl_Master_Pol_Lst"].Rows.Count;
for(int x=0;x<=(Colcnt-1);x++)
{
writer.Write(dsResults.Tables["tbl_Master_Pol_Lst"].Columns[x].ColumnName.Trim()+ ",");
}
writer.WriteLine();
for(int x=0;x<=(Rowcnt-1);x++)
{
for(int y=0;y<=(Colcnt-1);y++)
{
if (y == 2)
{
writer.Write("'" + dsResults.Tables["tbl_Master_Pol_Lst"].Rows[x].ItemArray.GetValue(y)+ ",");
}
else
{
String varData = Convert.ToString(dsResults.Tables["tbl_Master_Pol_Lst"].Rows[x].ItemArray.GetValue(y));
writer.Write(varData.Replace(","," ")+ ",");
}
}
writer.WriteLine();
}
writer.Flush();
MessageBox.Show(SD.FileName + " successfully created");
}
}
-::maximus::-
|
|
|
|
|
Thankyou zenithmaximus,
iam getting at savedialoguebox(SD)
iam using datagrid and also iam using paging for datagrid.
srinivas
|
|
|
|
|
Thankyou zenithmaximus,
iam getting at savedialoguebox(SD) <- you mean getting confused?
iam using datagrid and also iam using paging for datagrid.
the save dialogue statements is where you specify the path of where you're saving the data from your datagrid to a CSV file. The code applies to a scenario where you're saving your exported data from datagrid to a CSV(excel like) file, from clicking a botton.
-::maximus::-
|
|
|
|
|
iam getting error near save dialogue box C:\Inetpub\wwwroot\UserManagement\userdetails1.aspx.cs(170): The type or namespace name 'SaveFileDialog' could not be found (are you missing a using directive or an assembly reference?)
srinivas
|
|
|
|
|
Hi All,
I am new to C#. I have created a Windows Application and included a User Control in it. Now i want to use the User Control in my Form at Design Time. What is the procedure?
Thanks in advance.
|
|
|
|
|
Hello,
After you compiled it, you should see the UserControls in the Toolbox but not in the Standard Forms Controls.
There is a seperate region for your controls.
All the best,
Martin
|
|
|
|
|
I am unable to locate it. Could you help me out.
|
|
|
|
|
DumbDude.Dll wrote: I am unable to locate it.
Do you mean the Toolbox?
Ctrl+Alt+X
All the best,
Martin
|
|
|
|
|
I am sorry. I am unable to find User Control on Toolbox.
|
|
|
|
|
If you see your From in the design view (not in code view), and you look at the Toolbox in the Region UserControls.
If this is empty you can rightmouseclick at the toolbox and select "Add/Remove elements".
Then you search for your "exe" file under ..\bin\debug and doubleclick it .
The List should then contain your controls.
All the best,
Martin
|
|
|
|
|
Thank you very much Martin.
It works.
Thanks once again.
|
|
|
|
|
You are very much wellcome!
P.S.: There is a VisualStudio Forum[^] here on CP, for questions like this.
All the best,
Martin
|
|
|
|
|
Hello friends,
I want to turn off AGC (Automatic Gain Control) in WinXP and
Windows Vista also. How to do that.
Thanks in Advance.
Rahul Kulkarni
|
|
|
|
|
This automatic gain control[^]? What does it have to do with XP or Vista?
Anyway, this forum is for C# programming questions. You'll probably get better answers if you post your question in a more appropiate forum (probably outside CodeProject).
[EDIT: ok, I see how it is related to Windows. But how to do it programatically, I have no idea]
-- modified at 1:02 Thursday 26th July, 2007
|
|
|
|
|
Turning off the AGC cant be that hard in XP;
http://www.google.com/search?hl=en&rlz=1B2GGGL_en___AU221&q=turn+off+AGC+Windows+XP&btnG=Search
|
|
|
|
|
Thanks for REPLY.
But my friend i want to turn off AGC control through coding in C# only.
Not mannually. Thats why i asked this in C# forum only.
Rahul Kulkarni
|
|
|
|
|
you should have said so to begin with.
|
|
|
|
|
Hi,
I want to access Outlook Express programatically using C# in my Windows Application?
How can I do that?
Any Idea??????
Thanking you in advance
Jaz
|
|
|
|
|
|
Hi
Thanks for your reply,;)
But I want to access "Outlook Express" not Outlook....
I can access outlook Programmatically but I didnt find any useful information to access Outlook Express using C#
?????????????
Thanks
Jaz
|
|
|
|
|
Dear All,
Suggestion(s) required to use AJAX on Framework 1.1 (Visual Studio 2003)
would be greatly appericated if download source and help is provided
Thank You!
"Mess with the Best, Die like the rest"
|
|
|
|
|
We have used MagicAjax.NET[^] and it works nicely.
Also, I have read good things about Anthem.NET[^], although I have never used it.
I hope this helps!
|
|
|
|
|
Manning have a book called AJAX in Action. I read portions of that, and rolled all my own AJAX code, it's really not hard. IF you're looking for a bunch of cool AJAX controls, that's another question, but if you just want to use AJAX, then there's no reason to need any framework.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|