|
dataset is ok, i am just using dataset, u could use:
strExcelFile= objExport.TransformDataTableToExcel(ds.datatable(i),True)
objExport.SendExcelToClient(strExcelFile)
Also u have to have some polishment of ExcelExport.vb so as to run it in vs2003.
If u have any more question, u could sent email to me.
wish u could succeed!;P
Regards,
Steven
|
|
|
|
|
hi!
can some one guide me how to get value from the column of a dataset as we get from datareader(i-e dr["String column name"])
thanks in advance
regards
shezi
|
|
|
|
|
You can get that like this:
dataset.Tables[0].Rows[0][0].ToString();
This will give you the value of the first column of the first row of the dateset.
Best Regards,
Apurva Kaushal
|
|
|
|
|
u can use
dataset.table["table name"].Rows[row number]["column name"];
rahul
|
|
|
|
|
private string GetWebContent()
{
string fullpath = @"http://www.google.com";
HttpWebRequest webreq = (HttpWebRequest)System.Net.WebRequest.Create(fullpath);
HttpWebResponse webresp = (HttpWebResponse)webreq.GetResponse();
StreamReader strm = new StreamReader(webresp.GetResponseStream(), Encoding.ASCII);
String text = strm.ReadToEnd();
strm.Close();
return text;
}
This is my code. it works well on my own computer, but when i put in my office computer, there is a WebException:
"The underlying connection was closed: Unable to connect to the remote server."
why? is it because the setting of firewall in the office server or something.
Thanks very much
|
|
|
|
|
It uses system IE settings. Are you able to use google.com in your office computer.
And IE profiles might interfere too.
|
|
|
|
|
Thanks.
i can use www.google.com in my office computer through IE.
and i do not understand "And IE profiles might interfere too"
could you explain it for me, and how to fix it then?

|
|
|
|
|
hello,
while converting a vb.net application to c#, one pagechangedeventhandler event in vb.net application gives error in C# . Also overridden finally method also gives error in C# and suggest to provide destructor. But also not allow to declare destructor in an abstract class.
I have converted vb code to C# . but not able to run the application due to above errors.
plz help
regards,
max
|
|
|
|
|
One thing you can try is to take the compiled assemblies of your application writtne in VB and then use .NET Reflector[^] to have it decompile and export the IL code in C#. Then you can compare what the decompiler did in the same section of code where yours is failing.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Can you post the original VB code that you feel isn't being converted correctly? I'll convert it for you.
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
Hello
how can i check that if my string is an integer or not ? if yes then return true else false;
plz help
regards,
max
|
|
|
|
|
u can convert ur string into array of char and then can check it through
method Char.IsNumber()
rahul
|
|
|
|
|
int result;<br />
bool isInt = int.TryParse("123", out result);
|
|
|
|
|
use Try and catch block with
int.parse
or
convet.int32() method.
if any error occur then false
else true.
Rajesh soni
|
|
|
|
|
Another good way:
If Not IsNumeric(strString) Then
bool = False
Else
bool = True
End If
Nathan Lindley
.NET Aficionado
|
|
|
|
|
hey guys,
i got one more solution . its just like
if(convert.toint(str) is int)
{
return true;
}
else return false;
thanks for the replies.
|
|
|
|
|
how can i delete a file from given location.
such as i want to delete file aa at given loaction c:\\abc\xyz\\aa.txt.in asp.net 2005 with c#
dcjoshi2
|
|
|
|
|
Hi
Use this it might help u
System.IO.File.Delete(Server.MapPath("filetodelete.ext"));
Thanks
Aavesh
|
|
|
|
|
System.IO.File.Delete("c:\\abc\xyz\\aa.txt");
(This does not give an exception if the file does not exist.)
---
b { font-weight: normal; }
|
|
|
|
|
Is it possible in Asp.net to display in a dropdownlist both name and values at a time(Like listview in vb.net).
If not possible with the dropdownlist wat we have to use to do so.
i need to display both values for selection.give me a suggestion
thanks in advance.
|
|
|
|
|
You can simply create a property in you underlying object called something like 'DisplayName' and use that as your DataTextField. For example, if you were wanting to display a list of States and you had state objects, you could do this:
public class State
{
private string code;
public string Code
{
get { return code; }
set { code = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
public string DisplayName
{
get { return string.Format( "({0}) {1}", code, name ); }
}
}
So now when you set your dropdownlist fields, just use 'DisplayName' as your DataTextField and use 'Code' as your DataValueField.
List<State> states = GetAllStates();
ddlStates.DataTextField = "DisplayName";
ddlStates.DataValueField = "Code";
ddlStates.DataSource = states;
ddlStates.DataBind();
Hope that helps.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Like Matt said you can concatenate the two fields and bind it to the control, another option is that you can use a custom dropdownlist that supports displaying data with multiple columns like this one[^], you can find more available out there.
|
|
|
|
|
i use SQL Server 2000 and asp.net 1.1
i have MultiLine TextBox in my Site ,, admin add the text and press Enter to have newline Line and save it in the database
but in my label that want to show the text , new lines don't show
Why ?
MHf
|
|
|
|
|
HTML ignores newlines unless it is encompassed within a PRE tag. You may need to use BR tags to introduce line breaks.
|
|
|
|
|
You need to do something like:
....
string value = "......";
Label1.Text = vallue.Replace(Environment.NewLine, "<br/>");
...
|
|
|
|