|
-
Apr 11th, 2007, 04:35 AM
#1
Thread Starter
Addicted Member
[02/03] Stuck in C# code
Hi,
i am very new to C#.
Actually i have written these lines of code in class file.But it is giving error.-- near dataset word --Expected Class,enum,structure,delegate, interface,why , what may be the problem, same lines of code in vb.net is working fine.
Code:
using System;
using System.Data;
using System.Data.SqlClient;
public static DataSet returndataset(string connectionstring, string str)
{
SqlConnection con = new SqlConnection(connectionstring);
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand(str, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
return ds;
}
Kindly help me to solve this problem.And suggest some links to study C#.
Thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|