|
Christian Graus wrote:
Does VB not test equality with == ?
No, when i put in that extra = i get the error expression expected.
Now the compiler output. I must be doing something wrong, and i am more used programming things in PHP than .NET ). I am a old guy that has to learn some new tricks.
Compiler Error Message: BC30456: 'Column' is not a member of 'System.Web.UI.WebControls.DataList'.
Source Error:
Line 50: DataList1.DataBind()
Line 51:
Line 52: If DataList1.Column("Geslacht") = 1 Then
Line 53: Geslacht = "Jongen"
Line 54: 'ElseIf DataList1.Column("Geslacht") = 2 Then
|
|
|
|
|
gharryh wrote:
Compiler Error Message: BC30456: 'Column' is not a member of 'System.Web.UI.WebControls.DataList'.
Gosh - well, where did you get DataList1.Column from ? The error appears to be telling you it's not valid code. DataList1.Items will give you the rows in the datalist.
However, as you were supposed to be going through a data source, I wonder if you've got the wrong variable ? A DataListItem or a Row on a table seem more likely to be the place you'd look for this sort of info. I think they both have an indexer for column names, so MyDataItem("Geslacht") would be what you want.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Gosh - well, where did you get DataList1.Column from ? The error appears to be telling you it's not valid code. DataList1.Items will give you the rows in the datalist.
Well thinking that DataList1.Rows.Count is a valid statement there should be something similair to check on a Column value.
|
|
|
|
|
OK - is your intellisense broken ? The IDE should show you what is available in a list when you hit the '.'. In any case, I think the indexer solution I suggested would work, have you tried it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian thanksfor the answer.
But i thinki wil stop programming. Something that can be done simple in PHP looks like hell in .NET if one is not used to it. And for me as a old 47 year old dog learning a new trick I hoped to find more direct answers and not something like Indexer and have you tryed it. Dont even know wat the indexer is.
But anyhow thanks for all the help
|
|
|
|
|
Sorry, I didn't mean to confuse, I gave you the code, the indexer works like this : MyDataRow("columnName").
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Does VB not test equality with == ?
nop, this operator doesn't exist in vb...
the assign operator is the same as the equality one...
you so understand that you cannot assign in an if statement as we could do in C/C++ with : if ((var1 = var2) == 3) ...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
gharryh wrote:
But this doenst work. Can anyone tell me why.
well, have you tried using breakpoints ?
does it enter into the first if ?
is the DataList correctly populated ?
use the debugger to see...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I tryed to read the debugger data but my knowledge of .NET is not that good.
If i read it correct the thing i want is not possible but how can i then check on a value in a database column.
Show Detailed Compiler Output:
c:\windows\system32\inetsrv> "c:\windows\microsoft.net\framework\v1.1.4322\vbc.exe" /t:library /utf8output /R:"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\windows\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\windows\assembly\gac\system.web.ui.mobilecontrols.adapters\1.1.0.0__b03f5f7f11d50a3a\system.web.ui.mobilecontrols.adapters.dll" /R:"c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\windows\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\kiddinsys\80c4fe54\a4ec71ea\owog6cgo.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\kiddinsys\80c4fe54\a4ec71ea\owog6cgo.res" "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\kiddinsys\80c4fe54\a4ec71ea\owog6cgo.0.vb"
Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322.573
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.
C:\Inetpub\KiddinSys\aa.aspx(52) : error BC30456: 'Column' is not a member of 'System.Web.UI.WebControls.DataList'.
If DataList1.Column("Geslacht") = 1 Then
|
|
|
|
|
how can i change an identity seed of a colomn via transact sql.
that colomn is primary key in relation ship between other tables.
i need to change its identity seed in my application by transact sql.
when i want to change it, the table is empty but the user should detemine it or change it to other value, by my application.
prog
|
|
|
|
|
I don't think you can change the seed of a column. You must drop the column (in an alter table statement) and recreate it with the new seed and increment. Of coarse, you must first drop the relationships before you can drop the column.
1. use ALTER TABLE to delete the foreign key relationship in the other table
2. drop the identity column using ALTER TABLE
3. add the identity column back with the seed and increment you want using ALTER TABLE
4. add the relationship back into the other table using ALTER TABLE
Not a pleasant operation. In general, it is not good to use an identity column if you are expecting particular values; it might be better to design a stored procedure to generate the values you want, and put them in an ordinary int column with a UNIQUE constraint.
|
|
|
|
|
I have a 1 row record with several columns SectB1, SectB2, SectC1, SectC2 etc. In SectA1 cell, I have something like M1Y1472: All I want to do is to have |M|1|Y|1|47|2, that is eveything in its column. The same hing has to happen to SectB2, SectC1, SectC2 etc. Finally, I will have something like:
B1 B2 B3 ....C1 .....Cn
M 1 2
F 1 1
F 1 1
M 1 1
M 5 2 1
M 6 2 1
F 2 1
thank you
phokojoe
|
|
|
|
|
What are you trying to do? I don't understand.
<italic>Work hard, Work effectively.
|
|
|
|
|
I have a table with rows and columns. In a column, say A I have cell contents as 12345 etc.
That is i have something like:
Column
Row 12345
Now what I want to do is to separate the numbers in that cell as in 1 23 4 5, so that 1 is in its column, 23 in its column, 4 in its column 5 in its column but all in the same row:
Column1 Column2 Column3 Column4
Row 1 23 4 5
If I can be helped in that one cell, I think I will be able to handle the other cells.
help needed urgently!
phokojoe
|
|
|
|
|
What's the pattern? Why does 1 in its column and 23 in another column?
<italic>Work hard, Work effectively.
|
|
|
|
|
I have a table with rows and columns. In a column, say A I have cell contents as 12345 etc.
That is i have something like:
Column
Row 12345
Now what I want to do is to separate the numbers in that cell as in 1 23 4 5, so that 1 is in its column, 23 in its column, 4 in its column 5 in its column but all in the same row:
Column1 Column2 Column3 Column4
Row 1 23 4 5
If I can be helped in that one cell, I think I will be able to handle the other cells.
help needed urgently!
phokojoe
|
|
|
|
|
Maybe you can do it in your code. You save the data as 1,23,4,5. Read the data, when "," is found put it into the next column. I can't help much, if you didn't give more information.
<italic>Work hard, Work effectively.
|
|
|
|
|
Ok! Thank you for responding. All I can say for example column1 will hold Gender, Column2 will hold Age, column3 will hold say Position"
Initially, I have:
Column
Row 12345
And like I said all I want is a procedure or a way of having it like this:
Gender Age Position Class
Row 1 23 4 5
I hope this time I have made it clear.
Thanks once again!!
phokojoe
|
|
|
|
|
For that you can use,
insert into tableName(gender,age, position, class) values (1,23,4,5)
Why do you want to separate it, when you can do it easily with the way above?
<italic>Work hard, Work effectively.
|
|
|
|
|
It looks like you do not understand. What I am saying is that my dataset is in this form: Column(Data)
Row 12345
which is (Gender age position and class concatenated together).
that is I have in a cell column a data in that form and all I want to do is to separate the contents of the column(Data) to separate that and have
Gender Age Position Class
Row 1 23 4 5
I think now it makes more sense.
The insert statement I have used it many times and have no problem with that.
phokojoe
|
|
|
|
|
Is the problem solved? What I'm saying is you don't need to save the data in 1 column, if you have gender, save it in the gender column, etc. You're just making trouble for your self. I hope, I didn't miss understood you.
<italic>Work hard, Work effectively.
|
|
|
|
|
Thanks Yulianto. I will try not to create trouble for myself. The reson why I had that kind of a situation is that, I used a scanner to capture data , so in my questionnaire design, I had group the variables like that so as not to crowd the questionnaire.
Thank you
phokojoe
|
|
|
|
|
Yulianto
Can you show me a line of code whereby if I have data stored in as 1,2,3,4 and I want to read data set, when I find "," I put it in a next clolumn. Sy, when read a data set 1 when i find "," i put 1 in the next column.
phokojoe
|
|
|
|
|
phokojoe wrote:
read data set, when I find "," I put it in a next clolumn
Are you going to save from the data set? I don't get it.
<italic>Work hard, Work effectively.
|
|
|
|
|
I will read that data from a table and then save it to another table. I think the code that you are going to show me, I will create a stored procedure and then run it to save it to another table.
I think, I have made my point clear.
thank
phokojoe
|
|
|
|