|
Hello.
I connect to my Microsoft Access DataBase (.mdb) easily.
But when i set a password for my database i can't connect to it.
The "Data Link Properties" window give error to me !!!
Why ?
|
|
|
|
|
user : Admin ; Password :************, one that u set
|
|
|
|
|
I have two tables, one having only 4 records the other many.
The first called Speelzalen is indexed on Speelzaalnummer.
The second one called Groepen has at least one column called Speelzaalnummer but is not indexed on that Column. I retrieve data from boyh by:
sqlCommand = New SqlCommand("Select * from Speelzalen INNER JOIN Groepen ON Speelzalen.Speelzaalnummer = Groepen.Speelzaalnummer", sqlConnection)
After this i bind the result to two datalist and use them like this:
<td width="125"><asp:listbox id="DataList3" runat="server" Rows="1" DataTextField="SpeelzaalNaam" DataValueField="SpeelzaalNaam" /></td>
and
<td><asp:listbox id="DataList2" runat="server" Rows="1" DataTextField="Groep" DataValueField="Groep" /></td>
It all works fine with one exception: for all the records in Groepen there is alse a entry in the SpeelzaalNaam listbox, but there should only be four.
The question is two folded, one; is there a Select construction to be used to undouble the exces records, or second; is there a way to show only those records from the group database that are connected to the row in the Speelzalen table.
|
|
|
|
|
if you want to avoid multiple lines with the same datas, replace select with select distinct
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
No success, this is the SQL Line i use:
sqlCommand = New SqlCommand("SELECT DISTINCT Speelzalen.SpeelzaalNaam, Groepen.Groep, Groepen.Dagdelen FROM Speelzalen INNER JOIN Groepen ON Speelzalen.Speelzaalnummer = Groepen.Speelzaalnummer", sqlConnection)
|
|
|
|
|
I should mention that in the table Groepen there is more than one Row that contains a same PeuterzaalNummer
|
|
|
|
|
Hi there,
I have selected a single row from a database and put it in a DataList.
One column has a Integer and i cant display that on a form so i want to change it to certain string value first. It looks like:
If DataList.Column("Gender") = 1 Then
Gender = "Boy"
ElseIf DataList.Column("Gender") = 2 Then
Gender = "Girl"
Else
Gender = "Unknown"
End If
But this doenst work. Can anyone tell me why.
|
|
|
|
|
Does VB not test equality with == ?
Try putting DataList.Column("Gender") into an object, and looking at it in the debugger. I'd have thought you'd need to wrap it in Convert.ToInt16. I'd also use a switch here, rather than if/else. Only because it's nicer code.
And for future reference, 'it doesn't work' is useless. How doesn't it work ? What's happening ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
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.
|
|
|
|