473,513 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exact error of what I'm trying to achieve

J
Further to my post below, I've tried to replicate the error in a hope that
I'm definately doing something wrong, and it's not my code. The following
DOES work.

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

SqlConnection1.Open()

SqlCommand1.Parameters("@members").Value = "1007,4200,999"

daTest.SelectCommand = SqlCommand1

daTest.Fill(dsTest, "TestTable")

Dim dvTest As New DataView(dsTest.Tables("TestTable"), "", "",
DataViewRowState.CurrentRows)

DataGrid1.DataSource = dvTest

DataGrid1.DataBind()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

If Not IsPostBack Then

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim newrow As DataRow

newrow = dsTest.Tables("TestTable").NewRow

newrow(0) = "1"

newrow(1) = "Jason"

newrow(2) = "1"

dsTest.Tables("TestTable").Rows.Add(newrow)

DataGrid1.DataBind()

End Sub

If you were to move the code from page_init, into the If Not IsPostBack
command, then it fails.

Can someone PLEASE explain to me what on earth I'm doing wrong.

TIA

Nov 17 '05 #1
1 968
See my reply to your first post.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"J" <nospam> wrote in message news:eD**************@TK2MSFTNGP09.phx.gbl...
Further to my post below, I've tried to replicate the error in a hope that
I'm definately doing something wrong, and it's not my code. The following
DOES work.

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

SqlConnection1.Open()

SqlCommand1.Parameters("@members").Value = "1007,4200,999"

daTest.SelectCommand = SqlCommand1

daTest.Fill(dsTest, "TestTable")

Dim dvTest As New DataView(dsTest.Tables("TestTable"), "", "",
DataViewRowState.CurrentRows)

DataGrid1.DataSource = dvTest

DataGrid1.DataBind()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

If Not IsPostBack Then

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim newrow As DataRow

newrow = dsTest.Tables("TestTable").NewRow

newrow(0) = "1"

newrow(1) = "Jason"

newrow(2) = "1"

dsTest.Tables("TestTable").Rows.Add(newrow)

DataGrid1.DataBind()

End Sub

If you were to move the code from page_init, into the If Not IsPostBack
command, then it fails.

Can someone PLEASE explain to me what on earth I'm doing wrong.

TIA

Nov 17 '05 #2

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

Similar topics

9
2993
by: Jani Jalkala | last post by:
I have PHP 4.3.7 running on my client's Windows 2003 server. The same computer also runs SQL Server and I am trying to connect from PHP to a database. This fails, so I would like to track down the...
8
357
by: Bob | last post by:
I tried this in <input name="some_name" type="text" value="" onChange="auto_select(0);"> but it gives a syntax error. var cb = this.form.name alert( "name=" + cb )
19
3545
by: Martin Oddman | last post by:
Hi, I have a compiling problem. Please take a look at the code below. I have an application that is built upon three tiers: one data tier (Foo.DataManager), one business tier (Foo.Kernel) and...
12
10054
by: GRoll35 | last post by:
I get 4 of those errors. in the same spot. I'll show my parent class, child class, and my driver. All that is suppose to happen is the user enters data and it uses parent/child class to display...
5
6169
by: Mike Currie | last post by:
Can anyone explain why I'm getting an ascii encoding error when I'm trying to write out using a UTF-8 encoder? Thanks Python 2.4.3 (#69, Mar 29 2006, 17:35:34) on win32 Type "help",...
3
2262
by: baka | last post by:
Dear Sir/madam Here i am having some one sql which returns more rows than the required rows after comaparing tables simple sql statement will be lokk like SELECT t.empcd, s.daicd, s.chucd,...
5
2158
by: Mike Collins | last post by:
I am trying to export data from multiple tables in SQL Server to an XML file so I can then import it to another database. It seems to be working fine for exporting, but I am having trouble...
7
3229
by: Arun Srinivasan | last post by:
I have a problem, I am getting SQL1042N The SQL statement is not supported. error when I try to create a MQT against a nickname. The source db is db2 version 9.1 fixpack 4, same as the target db...
11
2483
by: markryde | last post by:
Hello, Followed here is a simplified code example of something which I try to implement; in essence , I want to assign a value to a return value of a method is C. I know, of course, that in this...
0
7157
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
7379
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,...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.