K
Kali
I have an asp.net page that works great in VB.NET, however, I can't seem to
get it to work in C#.
The VB.NET code is...
session("da") = New SqlDataAdapter(strSQL, cn)
session("ds") = New DataSet
session("da").Fill(session("ds"), "titles")
session("dtSource") = session("ds").Tables("titles")
I'm trying the following C# code but it wont compile...
Session["da"] = new SqlDataAdapter(strSQL, cn);
Session["ds"] = new DataSet();
Session["da"].Fill(Session["ds"], "titles");
Session["dtSource"] = Session["ds"].Tables("titles");
..Fill and .Tables causes the error.
I've tried...
(SqlDataAdapter)Session["da"].Fill(Session["ds"], "titles");
(DataSet)Session["dtSource"] = Session["ds"].Tables("titles");
but still wont compile. Any thoughts on how I can correct this issue? I do
require these in session... trying to port an old VB.NET app.
Thanks in advance.
Kal
get it to work in C#.
The VB.NET code is...
session("da") = New SqlDataAdapter(strSQL, cn)
session("ds") = New DataSet
session("da").Fill(session("ds"), "titles")
session("dtSource") = session("ds").Tables("titles")
I'm trying the following C# code but it wont compile...
Session["da"] = new SqlDataAdapter(strSQL, cn);
Session["ds"] = new DataSet();
Session["da"].Fill(Session["ds"], "titles");
Session["dtSource"] = Session["ds"].Tables("titles");
..Fill and .Tables causes the error.
I've tried...
(SqlDataAdapter)Session["da"].Fill(Session["ds"], "titles");
(DataSet)Session["dtSource"] = Session["ds"].Tables("titles");
but still wont compile. Any thoughts on how I can correct this issue? I do
require these in session... trying to port an old VB.NET app.
Thanks in advance.
Kal