Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 22nd, 2005, 12:41 AM
Registered User
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem With Datadapter.update

The Following Code is used but the data Doesn't get Updated in Database.
The Same Table is used in datatable & Select Statement table Name is Passed to a Function. The Code Function is Posted Here.
    Function CreateCmdAndUpdate(ByVal StrServerName As String, ByVal StrUserName As String, ByVal StrPwd As String, ByVal StrTableName As String, ByVal FillDataTable As DataTable)
        Dim SqlCon As SqlConnection
        Dim SqlCmd As New SqlCommand
        Try
            Dim SqlConStr As String = "server=" & StrServerName & "; database=temp; uid=" & StrUserName & "; pwd=" & StrPwd & "; integrated security=sspi"
            SqlCon = New SqlConnection(SqlConStr)
            SqlCon.Open()
            Dim Myds As DataSet = New DataSet
            SqlCmd.CommandText = sqlstr
            Dim sqlda As New SqlDataAdapter("SELECT * FROM " & StrTableName, SqlCon)
            Dim sqlCb As New SqlCommandBuilder(sqlda)
            sqlda.Fill(Myds)
            Myds.Tables.Add(FillDataTable)
        sqlda.update(myds)
        Catch ex As SqlException
            MessageBox.Show(ex.Message, "Candeo-SMT V2.0", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Return False
        Finally
            SqlCon.Close()
        End Try
 
Old October 22nd, 2005, 08:55 AM
Registered User
 
Join Date: Oct 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rishiraj_johri
Default

hello everybody,

this is rishi from india

i am a microsoft certified dotnet professional and i am a web developer, currently i am making a dynamic web site using asp .net with sql server 2000 enterprise edition on windows advance server 2003.

but unfourtunatlly i am facing a problem,

kindlly tell me that how can i select a perticular column or field from data grid

 
Old October 22nd, 2005, 09:00 AM
Authorized User
 
Join Date: Jul 2005
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rishi,

You can check in the correspnding Controls like this:

e.Item.Cells(4).Controls.FindControl(ctrlId);

where e would the DataGrid Item (Sender)

Did this attend to your query?

Vasudevan Deepak Kumar
Personal Web: http://www.lavanyadeepak.tk/
I Blog At: http://deepak.blogdrive.com/
 
Old October 24th, 2005, 01:00 AM
Registered User
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 Kindly answer my pblm also






Similar Threads
Thread Thread Starter Forum Replies Last Post
Update problem aceaceace Visual Basic 2005 Basics 6 February 21st, 2007 10:25 PM
Update problem filipczako ADO.NET 6 December 15th, 2005 11:58 AM
Update Problem skwilliams Classic ASP Databases 0 December 1st, 2005 11:02 AM
Update problem acko SQL Server 2000 3 June 29th, 2004 01:50 AM
update problem Justine Classic ASP Databases 21 May 26th, 2004 04:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.