moving data from vb.net 1.1 Datagrid to sql server 2005 database

Hi,

I was hoping someone could help me with a problem I am having. I can get the datagrid to populate from the database fine, like so:

    Public Sub BindTheData()

        Dim strConn As String
        strConn = System.Configuration.ConfigurationSettings.AppSettings("ConnectionString")
        Dim objConn As SqlConnection
        objConn = New SqlConnection(strConn)
        Dim myCmd As SqlCommand
        myCmd = New SqlCommand
        myCmd.Connection = objConn
        myCmd.CommandType = CommandType.StoredProcedure
        myCmd.CommandText = "AnswerDataGrid"
        Dim DS As SqlDataReader

        Dim UserID As New SqlParameter("@User_ID", Session.Item("user_id"))
        Dim DivID As New SqlParameter("@Div_ID", DropDownDivision.SelectedValue())
        Dim CatID As New SqlParameter("@Cat_ID", DropDownCategory.SelectedValue())
        myCmd.Parameters.Add(UserID)
        myCmd.Parameters.Add(DivID)
        myCmd.Parameters.Add(CatID)
        objConn.Open()
        dtgProducts.DataSource = myCmd.ExecuteReader(CommandBehavior.CloseConnection)
        dtgProducts.DataBind()

        'make sure you close datareader, and connection to DB
        myCmd.Dispose()
        objConn.Close()

    End Sub

 

--The problem I am having is that the datagrid has a row of checkboxes, and a row of textfields for the user to check and write notes. When trying to update back to the database, I cannot push the table back to the database for updates. Thanks in advance for the help, this problem has been driving me nuts.

Chris

0
laeros
7/15/2008 4:16:09 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

3 Replies
717 Views

Similar Articles

[PageSpeed] 11

Hi laeros ,

Please show me inline code.

 



Samu Zhang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
Samu
7/17/2008 7:42:42 AM

Hi,

I am considering that yopur checkbox is inside the templatefield so that i have developed the same application for updating using cheched box's checked event so try to use Button event and then using find control find checkbox and try to use following code

For Each gvr As GridViewRow In GridView2.Rows

Dim isChecked As Boolean = DirectCast(gvr.FindControl("chkBox1"), CheckBox).Checked

If isChecked = True Then

YOUR CODE FOR UPDATION

EndIf


Thanks
Parth
visit for some interesting articals at
www.parthrawal.blogspot.com
Mark as Answer if it helps you
0
parthrawal
7/17/2008 7:49:16 AM

 

Ah sorry, I figured out the problem before my post was cleared to show up. I was not placing a control inside the templatecolumn and databinding it properly. I have another question, but I will close this thread and open another to ask it.

Laeros

0
laeros
7/17/2008 2:37:42 PM
Reply:

Similar Artilces:

.NET 1.1 and SQL Server 2005
Hi, I am migrating my client's site from SQL 2k to 2005. The site was built on .NET 1.1 In order to run SQL 2005, do we need to upgrade to .NET 2.0 in order to run the site? If we do need to upgrade to .net 2.0, is there any way to get around the problem and run it on .NET 1.1. This is because we have a lot of 3rd party componenet which only support .NET 1.1 Thanks in advance. Paul...

Problems while porting .Net framework 1.0 (VB.Net) application to .Net Framework 1.1
Hello,   I have a ASP.Net web application,written in VB.Net,developed on .Net Framework 1.0 .I am trying to port it on to .Net framework 1.1.   For achieving this,I follow the following steps-   1.Open the project using the .vbproj file. 2.I am prompted with the conversion message "Do you want to convert the solution and all projects to .Net framework  1.1....." 3.I click "Yes" 4.I assume that the project is now converted. 5.I build the project & try to run it. 6.I get the following error -     Server Error in '/Consert.Net' Application. ...

.net 1.1 and SQL Server 2005 #2
Hi,I run .net 1.1, VS2003 with SQL Server Enterprise Manager v 8.0 on my home XP Pro machine.I have recently purchased some hosting with SQL Server 2005 capabilities.  I was in a real rush but I should have checked I suppose.I would love to be able to use my Enterprise Manager but obviously that wont work as it isnt compatible with 2005. It would be preferable not to have to use the web based admin and I have been told I have to install Microsoft SQL Server Management Studio Express, which requires .net 2.0 to be installed. It seems a bit of a mess really.Can anyone enlighten me as to w...

.NET 1.1 running on SQL Server 2005
Hi, I am migrating my client's site from SQL 2k to 2005. The site was built on .NET 1.1 In order to run SQL 2005, do we need to upgrade to .NET 2.0 in order to run the site? If we do need to upgrade to .net 2.0, is there any way to get around the problem and run it on .NET 1.1. This is because we have a lot of 3rd party componenet which only support .NET 1.1 Thanks in advance. Paul No. You would need the 2.0 framework for sure. I think the SQL 2005 installation wizard would detect and install the framework for you.You dont need to upgrade your application to VS 2005, however.*******...

Running server controls compiled for .NET 1.1 in .NET 2.0
Hello, I have tried upgrading our ASP.NET 1.1 application to .NET 2.0 by using Web Application Projects, and it works beautifully. We use several 3rd party controls that we bought for use in .NET 1.1 and these seem to just work in .NET 2.0, except that I get an intermittent problem with one of them. Should DLLs compiled using .NET 1.1 simply work, except if they access classes that have been removed from the framework in .NET 2.0? If I have both .NET 1.1 and .NET 2.0 present on the machine and the ASP.NET application is configured to run using .NET 2.0 and I have a DLL compiled using .NE...

Post form with data to a external site (.net 1.1 vb.net)
Hi I have now been googling for hours and I can not find a answer. :-( I am programming a e-shop (.net 1.1) and what I want to achive is: Customer fillout form, clicks on the Pay button then should the following thing happen: 1. Form date is saved to the database ( normal vb.net code ) 2. The data that should be posted to the external form is create from the saved data   ( normal vb.net code ) 2. A post is done to an external site with created data as "post" data and then user is redirected to this site. Thanks   Christian   Use the System.Net.HttpWebRequest...

Can .net 1.1 work with SQL SERVER 2005 ?
 What should I do if I want my asp.net 1.1 work with sql server 2005I get wrong message : SQL Server does not exist or access denied It's HARD to be Advanced ProgrammerIrwan. Well, you don't need to change any code.. there is no different of working against a SQL 2005, it's the same way as working against SQL server 2000 etc. If you have some problem to connect to the SQL Server 2005, just check your connection string if it's correct. For example if you provide the right user name and password etc. The connection string for connecting to a SQL Server 2000 and SQL Serv...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! Have a look into this links http://en.wikipedia.org/wiki/.NET_Framework http://blogs.msdn.com/mohammadakif/archive/2006/12/03/net-3-0-different-versions-of-the-net-framework.aspx http://www.codeproject.com/aspnet/ComparisonASP1xASP20.aspAshok Rajawww.iGold.inDon't forget to click "Mark as Answer" on the post that helped you. This credits that m...

Post form with data to a external site (.net 1.1 vb.net) #2
Hi There I am programming a e-shop (.net 1.1) and what I want to achive is: Customer fill out form, clicks on the Pay button then should the following thing happen: Problem is that I need to do a "Clean post" like if the user would have pressed the submit buttom on a normal HTML page I don't need the result in the ASP application, the external site will take over from there. The syntax are ASP.net local application : form data is save in a local db ASP.net local application : A POST string is created ( I could create a FORM in real html but then the use has to press twice) The ...

Using Pull method with SQL server and VB.Net 1.1
I am using the developer 11 version of Crystal. I have created a few reports successfully using the push method (creating a dataset, populating it then assigning it to the report). Because of decision making that is needed in some of the sub-reports etc. I chose to use a larger dataset rather than many more database lookups returning smaller data sets. I am trying to figure out whether I can accomplish some of this using the pull method. I need to be able to use the same report from multiple sites using differnt databases and credentials. It LOOKS like if I try to use the pull method I ha...

upgrade from vb.net 1.1 to vb 2005
I have an application that was written by using Visual Studio 2003. After using Visual Studio 2005, I find it is easier for coding, therefore I would like to upgrade the existing source code in VB 2003 (VB.NET 1.1) to VB 2005.  Can I just simply open that VB.NET 1.1 source code in Visual Studio 2005 and let the wizard help me upgrade it to version vb 2005? Will there be any problem? Is there any other changes I need to make to allow me continue debug/program the application in Visual Studio 2005?  This is a live running application and has been run for few years. Recently there ...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

Writing Stored Procedure in .NET 1.1 and using in SQL Server 2005
Hi, I am working on an application in ASP.NET 1.1 and SQL Server 2005 as database.I wanted to use SQLCLR feature of SQL Server 2005. Is it possible that i write Stored Procedures in C# 1.1 and deploy on SQL Server 2005? as it is in case of C# 2.0. Please refer some good tutorial for it. Regards,Imran GhaniImran Abdul Ghani SQL Server requires 2.0. The .net team made a number of changes to the memory manager and gc so .net could be hosted in SQL Server....

is .net framework 1.1 same as .net framework SDK 1.1
is .net framework 1.1 same as  .net framework SDK 1.1 Basically Framework 1.1 of .NET includes the Sofware Development Kit (SDK) 1.1 http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET I think .net framework 1.1 is just the runtime library to view .net 1.1 programs.  the .net framework SDK 1.1 one is the actual development library used to create them.   Eri...

Web resources about - moving data from vb.net 1.1 Datagrid to sql server 2005 database - asp.net.presentation-controls

Want to preview our new DataGrid for Xamarin.Forms?
tl;dr Zumero.DataGrid is a Xamarin.Forms control for displaying data in rows and columns. If you would be interested in testing and previewing ...

Mad King DataGrid
This post is about scrolling in WPF and the egocentric DataGrid control. I’ll give the project background but if all you’re interested in is ...

Stack Overflow
Stack Exchange log in - careers - chat - meta - about - faq Questions Tags Users Badges Unanswered Ask Question Top Questions interesting 295 ...

Microsoft Silverlight - Wikipedia, the free encyclopedia
Microsoft Silverlight is an application framework for writing and running rich Internet applications , with features and purposes similar to ...

Flash Builder Plug-in for SAP Netweaver Gateway - Adobe Labs
Search Navigation Labs Home Wiki Home Technologies Alchemy Blueprint Camera Profiles and DNG Profile Editor Cirrus ColdFusion 10 DNG Codec Fireworks ...

Casaba Security » Products » X5s Testing Tool For Finding XSS Vulnerabilities
Security analysis, consulting, development and testing partners who understand your business strategy.

CodeGuru - Microsoft developers related ideas, articles, tips, tricks, comments, downloads, and so much ...
CodeGuru is where developers can come to share ideas, articles, questions, answers, tips, tricks, comments, downloads, and so much more related ...

Caliburn Micro: WPF, Silverlight, WP7 and WinRT/Metro made easy.
A small, yet powerful framework designed for WPF, Silverlight and WP7. It implements a variety of UI patterns for solving real-world problems. ...

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 11 Jul 2012

license-discuss@opensource.org: 11636: first draft of license proliferation committee report
FYI,the first draft report of the OSI's License Proliferation Committee.To join the OSI's license proliferation discuss email list, send anemail ...

Resources last updated: 11/28/2015 12:45:56 PM