473,396 Members | 1,891 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.

SqlDataAdapter Question

Am using a string to do select from a table
string strCon ="select subject, name, email, message ,date FROM newpost
WHERE postid="+postid

But i want to use it with a SQLAdapter like this:-

da = new SqlDataAdapter("select subject, name, email, message ,date
FROM newpost WHERE postid =+postid" ,myConn);

My code is in C#..
Is it ok!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
2 921
Yes Patrick, the ctor seems OK, but the select stmt would be

"select subject, name, email, message ,date FROM newpost WHERE postid
="+postid

HTH

regards
Joyjit

"Patrick Olurotimi Ige" <ig*@iprimus.com.au> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Am using a string to do select from a table
string strCon ="select subject, name, email, message ,date FROM newpost
WHERE postid="+postid

But i want to use it with a SQLAdapter like this:-

da = new SqlDataAdapter("select subject, name, email, message ,date
FROM newpost WHERE postid =+postid" ,myConn);

My code is in C#..
Is it ok!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #2
Thanks Joyjit for the reply.
But what do you mean by ctor or stmt??


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Programatix | last post by:
Hi, I'm working on a WebService project. I'm trying to validate data before they are updated to the database by handling the RowUpdating event for a SqlDataAdapter. The data being handled has...
6
by: goodstart123 | last post by:
For example, the following code works fine without SqlConnection. Any Answer to the question? string connectionString = "server=YourServer; uid=sa; pwd=YourPassword;...
3
by: Fernando | last post by:
I am having problems with updating the changes done over a DataSet to a Database. All the changes being done using the Form are stored in the Dataset, but when i decide to close the Form and open...
10
by: Victor | last post by:
Hello there, I have a module in VB.NET (ASP.NET) and on top I declare the SqlConnection and the SqlDataAdapter. Like: Module AccessDB Dim sqlCmd As New SqlCommand Dim conAanvraag As New
7
by: Matt Jensen | last post by:
Howdy Fairly simple question I think, I presume the answer is no it can't be reused for 2 *SELECT* statements, but just hoping for clarification. Just asking in the interests of trying to minimise...
1
by: Ranny | last post by:
Question: What is the process to Insert a record using Dataset and SQLDataAdapter? Explanation: Thanks to Cor I am able to get a record to load, modify it, and save it to the database. My...
1
by: archana | last post by:
hi all I have some doubts related to database handling in .net. I am using sqldataadapter to update and insert rows into database. What i want to know is at a time of inserting rows using...
1
by: languy | last post by:
Hi there I'm having a problem when using the SqlDataAdapter. When calling the Update(DataSet, string) method I get the following error message "String or binary data would be truncated". The...
1
by: kempshall | last post by:
When I use an SqlDataAdapter to fill a DataSet from a database, do I need to explicitly open and close the SqlConnection that I'm using? For example, I have code that looks like this: ...
0
by: dakvanslam | last post by:
I apologize if this is a simple question, but I am very new to SQL Server. I feel like I am missing something easy here. I an running VB ..NET from Visual Studio 2005 and SQL Server Express. The...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.