|
I think there must be some other css which overrides this. Check out.
You Can make a css class for the same and add using javascript when mouse comes over the anchor. Its an easy fix.
Or you can also use span to behave similar to anchor. Use onclick to navigate in span.
You can take either approach I think.
|
|
|
|
|
Hi guys,
Recently I've been experimenting with converting csv files from Yahoo Finance to XML data, and there is a great article on MSDN site about how to do so, with sample code provided. However, there's a "GenerateDataSet" class that fails to get recognized by my VWD 2008 Express, and I've tried importing all sorts of possible namespaces. After doing some research, it seems to be a Windows Form component rather than a web form component. I understand that the "GenerateDataSet" class is supposed to put the csv datastream into a dataset, however I'm not familiar enough with asp.net to come up with an alternative to make it work. Could you please help me? I'd greatly appreciate it!
Part of the sample code provided by MSDN (this function is supposed to read csv data online and return XML data:
<br />
Public Function getStockXML(ByVal strTicker As String, ByVal strStartDate As String, ByVal strEndDate As String) As XmlDocument<br />
Dim xReturn As New XmlDocument()<br />
Dim result As New DataSet()<br />
Dim wc As New WebClient()<br />
Dim yData As Stream = wc.OpenRead(sYahooURI) 'sYahooURI is the url link to Yahoo Finance csv file<br />
result = GenerateDataSet(yData)<br />
<br />
Dim stringWriter As New StringWriter()<br />
Dim xmlTextwriter As New XmlTextWriter(stringWriter)<br />
result.WriteXml(xmlTextwriter, XmlWriteMode.IgnoreSchema)<br />
Dim xRoot As XmlNode = xReturn.CreateElement("root")<br />
xReturn.AppendChild(xRoot)<br />
xReturn.LoadXml(stringWriter.ToString())<br />
Return (xReturn)<br />
End Function<br />
|
|
|
|
|
csv means Comma separated values. Why dont you use normal for loops to put all the values into a DataTable .
If you cant do it yourself, let me know with a sample demo of the schema. I will give you the code.
|
|
|
|
|
Thank you so much Abhishek for your help. I actually have thought about using for-next loops before, but when seeing the example posted on MSDN is doing it using a simple "GenerateDataSet" function, I thought it's a shortcut.
The original CSV file from Yahoo Finance looks like the following:
Date,Open,High,Low,Close,Volume,Adj Close
2009-10-23,15.91,16.10,15.41,15.48,27610400,15.48
2009-10-22,15.15,15.51,15.01,15.43,17517400,15.43
Basically I'm just having problem with the "result = GenerateDataSet(yData)" line, because I couldn't find the namespace that "GenerateDataSet" is under. If you could please give me the code for writing that csv stream into a dataset, that would be great!
Public Function getStockXML(ByVal strTicker As String, ByVal strStartDate As String, ByVal strEndDate As String) As XmlDocument<br />
Dim xReturn As New XmlDocument()<br />
Dim result As New DataSet()<br />
Dim wc As New WebClient()<br />
Dim yData As Stream = wc.OpenRead(sYahooURI)<br />
result = GenerateDataSet(yData)<br />
Dim stringWriter As New StringWriter()<br />
Dim xmlTextwriter As New XmlTextWriter(stringWriter)<br />
result.WriteXml(xmlTextwriter, XmlWriteMode.IgnoreSchema)<br />
Dim xRoot As XmlNode = xReturn.CreateElement("root")<br />
xReturn.AppendChild(xRoot)<br />
xReturn.LoadXml(stringWriter.ToString())<br />
Return (xReturn)<br />
End Function
For your information, here's the link to that MSDN website:
http://msdn.microsoft.com/en-us/magazine/ee294455.aspx[^]
Thanks again for your help!
|
|
|
|
|
|
|
Where do you to to implement it ?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi,
I want to use a WYSIWYG editor for my project in asp.net 2.0 project which should free and having features like table, image uploading.
I have search many editors on web but either they are paid or having limitation.
Kindly suggest me if available.
Thanks in advance,
Abbas
|
|
|
|
|
|
ya, I already seen it, it's good but not having features as table or images.
Thanks for reply,
|
|
|
|
|
Try this[^]
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
Hi kashif,
I already seen it, it's good but not having features as table or images.
Thanks,
|
|
|
|
|
|
|
|
Hi all i want to disable the Refresh button
i just addeded javascript function for F5. and it works fine
here is my code works fine for F5
"function refresh()"+
"{"+
"if (116==event.keyCode)"+
"{"+
"event.cancelBubble = true;" +
"event.returnValue = false;" +
"event.keyCode = 0;" +
"return false;" +
"}"+
"}"+
"document.onkeydown = function (){ refresh(); } ");
but i cant diable the icon shown in tool bar for Refresh
can some one help me
thanks in advance
|
|
|
|
|
Try This..!
<Script language="javascript">
function checkKeyCode(evt)
{
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if(event.keyCode==116)
{
evt.keyCode=0;
return false
}
}
document.onkeydown=checkKeyCode;
</script>
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Controlling browser buttons is an idiotic idea. Actually you cant do it with 100% perfection.
|
|
|
|
|
jasome wrote: but i cant diable the icon shown in tool bar for Refresh
Actually you can't.
Only thing that you can do(what most banking site does) is you can open this in a new window with no toolbar. Thus the Refresh button never appears.
And you just remove the refresh facility from browser and you are done.
You should also remove the Right click context menu.
You might look into this to disable right click in browser:
http://www.codeproject.com/tips/42554/Javascript-hack-to-disable-Right-Click-and-Text-Se.aspx[^]
Cheers
|
|
|
|
|
Hi All,
i am logging into the application using login id and password. after varifying from the data base.
requirment is only u can log in only at one place using login id and password u can not login to another machine using same login id and password.
This thing i can do after adding one more field into the database setting value to true or false.
But what if power goes off where will i set value to false.
Thanks and regards,
Amit Patel
|
|
|
|
|
Have a look at global.asax application start event.
|
|
|
|
|
You can clear the Flag at Session_End event. As Session maintained on server side, and whenever session end called set the database flag to false. So you do not need to worries about it.
One more thing you need to, you need to also check browser close.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi All,
How to set flag when user cloase the brower .
Thanks and regards,
Amit Patel
|
|
|
|
|
|
how to use rollback mysql database in asp.net.
public void RunTransaction(string myConnString)
{
MySqlConnection myConnection = new MySqlConnection(myConnString);
myConnection.Open();
MySqlCommand myCommand = myConnection.CreateCommand();
MySqlTransaction myTrans;
myTrans = myConnection.BeginTransaction();
myCommand.Connection = myConnection;
myCommand.Transaction = myTrans;
try
{
myCommand.CommandText = "insert into Test (id, desc) VALUES (100, 'Description')";
myCommand.ExecuteNonQuery();
myCommand.CommandText = "insert into Test (id, desc) VALUES (101, 'Description')";
myCommand.ExecuteNonQuery();
myTrans.Commit();
Console.WriteLine("Both records are written to database.");
}
catch(Exception e)
{
try
{
myTrans.Rollback();
}
catch (SqlException ex)
{
if (myTrans.Connection != null)
{
Console.WriteLine("An exception of type " + ex.GetType() +
" was encountered while attempting to roll back the transaction.");
}
}
Console.WriteLine("An exception of type " + e.GetType() +
" was encountered while inserting the data.");
Console.WriteLine("Neither record was written to database.");
}
finally
{
myConnection.Close();
}
} this code is not workin
http://dev.mysql.com/doc/refman/5.0/es/connector-net-examples-mysqlconnection.html#connector-net-examples-mysqlconnection-begintransaction1
plz help....
|
|
|
|