|
Hi Every Body
i want know how can i write in excel files
ex:
i want write 3 words only each word i want it in seperate column
and i want to rename inner sheets from "Sheet1" to "xxx"
and create another sheet too
plz can any body help me ??
|
|
|
|
|
Go to this link:
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/ef11a193-54f3-407b-9374-9f5770fd9fd7/
Also, try this method as well:
http://codebetter.com/blogs/peter.van.ooijen/archive/2005/10/20/133409.aspx
Hope this helps ,
Prateek
|
|
|
|
|
<br />
void SomeFunction( array<Object^>^ &updatelist)<br />
The above function is written using in VC++ managed systax.
The equivalent of
<br />
array<Object^>^<br />
is Object[]<br />
I like to know what is the equalalent systax in C#.
Important: There is a address symbol before the argument name, which means passing an array by reference so that the array can be change from inside the function.
Any help is appreciated
Thank you
|
|
|
|
|
I believe this is what you are looking for:
void SomeFunction(ref object[] updateList) {
if(updateList == null) {
updateList = new object[10];
}
}
|
|
|
|
|
thank you for your suggession.
Actually I should rephrase my words. The VC++ function resides in a dll. when I tried to call this function from C# code, the intellisence showed me the following function signature in C#
<br />
void SomeFunction( object[]* obj);<br />
Now my question is ,how to pass a pointer to an array of object in C#.
Suppose I have the following array and I want to pass this array to the above function.
<br />
object[] obj = new object[4];<br />
This array will be modified in the dll and should reflect the modification in the C# program.
Thank you.
|
|
|
|
|
HI,all.
Today, when i want to get data from sybase table.
i have puzzled with a strang thing.
just like the title. when the program runs to the point, my program dipped into it. the program will not run to the next statement and also with no error threw out.
what is wrong? how could i get data from sybase table as i getting from oracle.
by the way,i could do insert,update,delete operating in my program.and one thing else,when i use oleDbDataReader to read data from sybase table, another problem happens,when i do "myReader.Close();".the same thing happens,the program will not go to next statement.
Here is my part codes:
public int LoadDataSetFromSYBASE(string sql, string tableName, ref DataSet objDataSet)
{
this.sybase_Connect();
int iCount = -1;
OleDbDataAdapter objOleDbDataAdapter = new OleDbDataAdapter(sql, this.sybase_con);
try
{
iCount = objOleDbDataAdapter.Fill(objDataSet, tableName);
}
catch(Exception e)
{
throw (new Exception("Error in LoadDataSetfromSYBASE method. " + e.Message));
}
finally
{
this.sybase_Disconnect();
}
return iCount;
}
public void LoadDataFromSYBASE(string sql,object obj)
{
using (OleDbConnection connection = new OleDbConnection(sybase_ConnectionString))
{
OleDbCommand command = new OleDbCommand(sql, connection);
connection.Open();
OleDbDataReader reader = command.ExecuteReader();
reader.Read();
obj=reader[0];
reader.Close();
}
}
MSN:msnadair@hotmail.com
Skype:skyadair
|
|
|
|
|
is it possible to import a dll file which was developed my C# in to a asp.net application?
self confidence+hard work=SUCCESS
|
|
|
|
|
Yes. You simply add a reference to it.
|
|
|
|
|
Don't cross post, picking one forum shall be fine.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
thanks
self confidence+hard work=SUCCESS
|
|
|
|
|
How can assign a null value to a field that is integer but allows null value.?
int? nullval = null;
mydataSet.mytable[myBindingSource.Position].myIntField = nullval ;
isn't found.....
|
|
|
|
|
Have you tried DBNull.Value ?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
yes, when compile have this error:
"cannot implicitly convert type 'System.DBNull.value' to int"
|
|
|
|
|
Of course not. You have to rewrite that little bit of assignment code you posted to check for a null value in the int, and then, if null, you have to assign DBNull.Value to your database column.
|
|
|
|
|
I solved it that way...
mydataSet.mytable[myBindingSource.Position].SetmyIntFieldNull();
Thank you very much...
|
|
|
|
|
You don't need the local variable.
|
|
|
|
|
Hello,
How to pass parameter to crystal reports from a C# (winform) application when my parameter is a string type and contain quate or double quate charecter?
I keep getting error "Error in formula" when it contains quate or double quate.
My parameter name is Address and the address contain double quate sign
Thanks in advanced
|
|
|
|
|
Try providing ASCII values for the double quotes or precede it with escape charachters.
Regards,
SPanicker.
|
|
|
|
|
No, It doesn't work.
I keep getting the same error
|
|
|
|
|
Can you please provide few lines of the code where u get the error?
Regards,
SPanicker.
|
|
|
|
|
C# code
-------
int intCopies = 1;
string strAddress = "6534 Burbank, next to the \"Amy Books\" bookstore";
string temp = orpt.DataDefinition.FormulaFields["Address1"].Text;
orpt.DataDefinition.FormulaFields["Address1"].Text = temp.Replace("Address1", strAddress1);
orpt.Refresh();
orpt.PrintToPrinter(intCopies, true, 1, 1); -------------------------
Crystal Reports
---------------
in crystal reports I have a formula named: @Address
formula text: "Address"
--------------------------
I'm using VS 2005 with Crystal reports version 8.5
Thanks!
|
|
|
|
|
Ok, I finally found it.
it has to be replaced by a double quate as follow
"The word ""hello"" is quoted."
so in C# it will be:
"The word \"\"hello\"\" is quoted."
thanks anyway!
|
|
|
|
|
Use paramterized queries instead of putting SQL strings together using string concatentation.
|
|
|
|
|
|