<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'delete command using DataAdapter in c#' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'delete command using DataAdapter in c#' posted on the '.NET WinForms' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2010 Programmers Heaven</copyright>
    <pubDate>Wed, 17 Mar 2010 00:48:37 -0700</pubDate>
    <lastBuildDate>Wed, 17 Mar 2010 00:48:37 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>delete command using DataAdapter in c#</title>
      <link>http://www.programmersheaven.com/mb/DotNetWinForms/409428/409428/delete-command-using-dataadapter-in-c/</link>
      <description>Hi All,&lt;br /&gt;
I am trying to insert/update/delete a field from my sql server table using dataadapter in c# windows application.&lt;br /&gt;
&lt;br /&gt;
Here insert and update are happening,but 'delete' is not working&lt;br /&gt;
&lt;br /&gt;
I will show my delete part :&lt;br /&gt;
&lt;br /&gt;
public int UpdateAllUserDetails(DataSet dsUsers)&lt;br /&gt;
    {&lt;br /&gt;
    private SqlConnection connection;&lt;br /&gt;
    private SqlCommand command;&lt;br /&gt;
    private SqlDataAdapter dataAdapter;&lt;br /&gt;
&lt;br /&gt;
connection = new   SqlConnection(ConfigurationManager.AppSettings.Get
("conString"));&lt;br /&gt;
connection.Open();&lt;br /&gt;
            dataAdapter = new SqlDataAdapter(command);&lt;br /&gt;
&lt;br /&gt;
 dataAdapter.DeleteCommand = new SqlCommand("DELETE FROM UserDetails WHERE vUserName=@vUserName",                                          connection);&lt;br /&gt;
 dataAdapter.DeleteCommand.Parameters.Add("@vUserNa
me", SqlDbType.VarChar, 50, "vUserName");&lt;br /&gt;
&lt;br /&gt;
 int ret = dataAdapter.Update(dsUsers);&lt;br /&gt;
            return ret;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
can somebody say what is missing here?&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/DotNetWinForms/409428/409428/delete-command-using-dataadapter-in-c/</guid>
      <pubDate>Tue, 17 Nov 2009 02:36:42 -0700</pubDate>
      <category>.NET WinForms</category>
    </item>
  </channel>
</rss>