Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Nishanth mahe

@Nishanth mahe
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • deleting sqlserver table data with delete command using DataAdapter in c#
    N Nishanth mahe

    Thanks kstls, But I have no dependencies for this because i am trying to delete some newly inserted userdetails data, which will create a new field in that single table only and not in any of the dependency tables. Here by debugging the code i am getting the update command as : "DELETE FROM UserDetails WHERE vUserName=@vUserName" which when run directly in DBMS just replacing vUserName as 'testuser' which is the primarykey vUserName : [ DELETE FROM UserDetails WHERE vUserName='testuser' ] is deleting properly But not working from code

    modified on Tuesday, November 17, 2009 6:48 AM

    C# question csharp database sql-server sysadmin

  • deleting sqlserver table data with delete command using DataAdapter in c#
    N Nishanth mahe

    Hi, I am trying to insert/update/delete a field from sql server table using dataadapter in c# windows application. Here insert and update are happening,but 'delete' is not working I will show my delete part : public int UpdateAllUserDetails(DataSet dsUsers) { private SqlConnection connection; private SqlCommand command; private SqlDataAdapter dataAdapter; connection = new SqlConnection(ConfigurationManager.AppSettings.Get("conString")); connection.Open(); dataAdapter = new SqlDataAdapter(command); dataAdapter.DeleteCommand = new SqlCommand("DELETE FROM UserDetails WHERE vUserName=@vUserName", connection); dataAdapter.DeleteCommand.Parameters.Add("@vUserName", SqlDbType.VarChar, 50, "vUserName"); int ret = dataAdapter.Update(dsUsers); return ret; } can somebody say what is missing here?

    C# question csharp database sql-server sysadmin
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups