|
|
it provide's me only a dataTable...
that's good for a start
but u cannot iterate (for/foreac) for all the tables
(without knowing the Tables name)
i like to run over all of it (without sending a table name to bring back)
kobkob
|
|
|
|
|
kobibi wrote: but u cannot iterate (for/foreac) for all the tables
(without knowing the Tables name)
Of course you can! Just use dataTable.Rows.Count and a for loop.
|
|
|
|
|
|
|
kobibi wrote: OdbcConnection dbCon = new OdbcConnection("DSN=myDataBase");
dbCon.Open();
string sSql = "SELECT Name FROM MSysObjects WHERE Type In (1)
AND Left([Name],4)<>MSYS";
OdbcCommand dbcom = new OdbcCommand(sSql, dbCon);
OdbcDataReader dbRdr = dbcom.ExecuteReader();
while(drRdr.read())
{
string newcmd= select * from + drRdr[0] ' one by one table
OdbcCommand dbcom2 = new OdbcCommand(newcmd, dbCon);
'now u can use in your won way
}
Happy Programming
-----
Abhijit
|
|
|
|
|
Look at that Error :
no read permission on 'MSysObjects'.
Because -
OdbcDataReader dbRdr = dbcom.ExecuteReader();
What.....
kobkob
|
|
|
|
|
|
I have run the program given below but iam not getting the values from excel can anyone help me out in this plz
using System;
using Excel;
namespace TestExcel
{
///
/// Summary description for ExcelApplication.
///
class ExcelApplication
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
string Path = @"D:\book1.xls";
// initialize the Excel Application class
Excel.ApplicationClass app = new ApplicationClass();
// create the workbook object by opening the excel file.
Excel.Workbook workBook = app.Workbooks.Open(Path, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows,
"\t", false, false, 0, true, 1, 0);
// get the active worksheet using sheet name or active sheet
Excel.Worksheet workSheet = (Excel.Worksheet)workBook.ActiveSheet;
string[] name =
{"SPACE_REF","LOCAL_SPACE_NAME","SPACE_AREA","SPACE_USE","CAT_CODE","SUB_CAT_CODE","SCHOOL_USE",
"NIA","EXCLUDED_%","SUFFICIENCY_SPACE_TYPE","SUFFICIENCY_STAUS_CODE","CEILING_HEIGHT","CEILING_TYPE",
"FLOOR_TYPE","CLN_SPEC","CLN_BY","FLOOR_REF","BUILDING_REF","SHARED_SPACE","SHARED_REF","SI_SKETCH_NO",
"UPRN","LMS%"};
int l;
l = name.Length;
for (int a =1; a
|
|
|
|
|
I'm not an expert at the Excel stuff but two things that stick out at me are
a) inside the while loop workSheet.Cells is being indexed with 1,1 for every iteration of the loop instead of i and j
b) also inside the loop the call to console.writeline is printing spaces, the string should be "{0}"
maybe that'll help . . .
|
|
|
|
|
hi all
How do i export a report (sql server reporting services) to the following formats using c# ??
o MS-Excel
o HTML
o MS-Word
o PDF
o CSV
o XML
o RTF
(anyone of the above would also be welcome);P
plss help!
thanks!
|
|
|
|
|
Office - use the office toolkit
PDF - buy a toolkit
CSV/XML/RTF - write the code to do it.
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 )
|
|
|
|
|
Christian Graus wrote: Office - use the office toolkit
PDF - buy a toolkit
CSV/XML/RTF - write the code to do it.
Looks like i wasnt very clear earlier
well i cant use any third party tools here , have to use c# strictly
or i have to do everything programmatically
|
|
|
|
|
k.philip wrote: have to use c# strictly
or i have to do everything programmatically
Isn't that the same thing? If you can only use C# then you can only do it programatically. For the office stuff, you can use the PIA, and make interop calls. It gives you a Word or Excel namespace, but you would still have to write the content programatically.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Hi,
I have one table belonged with one column like :
Items
-----
LION
CAT
DOG
HORSE
ELEPHANT
MOUSE
TIGER
ETC
-----------------
Kindly teach me how to collect them and how to show them with message box?
Thank you in advance
(Riaz)
|
|
|
|
|
I supose you have a datatable... I believe that only way to collect all column data is doing a loop for all rows and getting column value...
private string[] GetAllColumnValues(DataTable dt)<br />
{<br />
List<string> aValues = new List<string>;<br />
foreach(DataRow oRow in dt.Rows)<br />
{<br />
aValues.Add(oRow["colName or index"].toString());<br />
}<br />
return aValues.toArray();<br />
}<br />
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
|
hi all,
I m striving from couple of days to implement a list in my project similer to the Undo list in Visual Studio and MS Outlook.I m not able to do it yet.
So , please if anyone knows how to do it and have ever done it , please tell me.
I will be so thankfull of u .
Thanx.
Praveen Sharma
|
|
|
|
|
|
Hi all ,
We are creating an application in which we need to load an XML file , located in a seperate folder named "Resources" , where this folder is exist in the solution file.Following is the code snippet, in which im trying to load the xml file in the Stream object:
Ln1 Assembly assembly = Assembly.GetExecutingAssembly();
Ln2 string resourceName = String.Concat(typeof(WebForm1).Namespace,".Resources.","Features.xml");
Ln3 Stream objStream = typeof(WebForm1).Assembly.GetManifestResourceStream(resourceName );
Ln4 StreamReader objStreamReader = new StreamReader(objStream);
Ln5 XmlTextReader xtr = new XmlTextReader(objStreamReader);
Ln6 return xtr;
Here the string resourceName we are getting is "Utility_XML.Resources.Features.xml"
where
Utility_XML -->Name space
Resources --> Folder
After LineNo3 the value populated in the 'objStream' is "Undefined Value". so struck up in this stage. I really appreciate if some one could guide me to fix this issue.Thanks in advance!
Best Regards,
Krishna Chandran
|
|
|
|
|
Could any body please help how to develope an internet diler application in.net nd what are the requirements to run this dialer on Win9x ,XP nd windows server systems.Through this i have to display total MBs consumed and receving nd sending bytes info.I am completely new to this work.
Any help will be greatly appreciated.
Thanks
|
|
|
|
|
|
thank you abhijit for ur earliest response.I will go thorugh it.
|
|
|
|
|
thanks, and if u will get any another solu~n let me know
Happy Programming
-----
Abhijit
|
|
|
|
|
Hello,
I am having one private field which is encapsulated in public property.
As i can modify the field using the variable itself with in the class and through property outside the class.
Here the question is how should i modify the field....????
1)Through the property always, within the class or outside the class.
OR
2)Field within the class and use property outside the class.
I am agree with the 1st point because it increase the developers readabilty and easy to maintain.
Other side is the performance.. If i directly modify the variable, i am reducing one call which might give better efficiency.
So what is the better way???
|
|
|
|