473,396 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to store data in table format?

Hi every one i want to store data in data table and send that data in xml format to web service after fetching it from sql query can any one help me plz .Here is my code

string username = Request.QueryString["username"];
string password = Request.QueryString["password"];
int response;
string constr = "Data Source=ITS-BA-DC02\\MSSQL2008_SAND;Initial Catalog=TestDB_Chaitanya;User ID=sa;Password=01Explore";
SqlConnection conn = new SqlConnection(constr);
conn.Open();
SqlCommand cmd = new SqlCommand("select * from users where username = '" + username + "'and password='" + password + "'", conn);
SqlDataAdapter da = new SqlDataAdapter("select * from users where username = '" + username + "'and password='" + password + "'", conn);
SqlDataReader dr = cmd.ExecuteReader();
DataSet ds = new DataSet();
DataTable dt;
da.Fill(ds, "users");
Dec 21 '11 #1
1 2437

Sign in to post your reply or Sign up for a free account.

Similar topics

236
by: Andrew Rawnsley | last post by:
Anyone out there using beta 2 in production situations? Comments on stability? I am rolling out a project in the next 4 weeks, and really don't want to go though an upgrade soon after its released...
3
by: Forconi Boris via .NET 247 | last post by:
Hi, I'm working on a project in witch I have to list data(products that can be selected with a certain quantity) from anXML document, with key words entered by the user. A Table isdynamically created...
2
by: Steve Stover | last post by:
I want to use the caching API in .net to store data. The data would be stored in a data table class that has approx. 10 columns and 71 rows. What I need to know is this: According to Microsoft's...
2
by: LisaBigJax | last post by:
I am using a series of checkbox's in a repeater -- (not the checkboxlist) -- the problem I am encountering is that the checkbox does not have a value attribute. I tried to add it via the...
1
by: Woof | last post by:
Hi, I'm populating the nodes of a Tree View control via an SQL database, with the lowest child nodes (leaves from now on) Text field being set to a lengthy set of HTML. The outcome is a...
0
by: rose | last post by:
I have an ACCESS graph and when I turn on show data tables, the data table displays a whole number instead of the percentage like the graph. I have formatted the sourc query to be percentage, but I...
1
by: prasathas | last post by:
i am trying to display my datas in the table format that i am fetching from database... while running the progrom it doesnt shows any error.. but in client side scripting the coding shows error as...
2
by: troy_lee | last post by:
I have a form that screens the database. I build a dynamic WHERE clause into a string and apply it to the form's filter. I want to allow the user to save, say, five or 10 of their most-used...
1
by: raghulvarma | last post by:
I am developing windows application. Now I have got the data in the data set . Now I need that to be displayed in the table format, not in the grid.but in the table format as we get in web...
1
by: BaseballGraphs | last post by:
Hello, I am trying to divide one value from my data table with an associated ID by another value from my data table with a different ID for the same day that the value was added to the data table....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.