|
I have this code my friend, and its not working.I don have much time before the due date for my problem.I cant connect to the database.I cant do anything till I can connect to the database.
<%@ Language=VBScript %>
<%Option explicit
Dim oRs, conn, connect, strSQL
set conn=server.CreateObject ("adodb.connection")
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("courses.mdb") & ";Persist Security Info=False"
conn.Open connect
%>
<title>Example combo box
The following was selected : <%=Request.Form ("courses")%>
<%
Set oRs=Server.CreateObject("adodb.recordset")
strSQL = "SELECT DISTINCT CourseName FROM tblCourses ORDER BY CourseName"
oRs.Open strSQL, conn
Do while not oRs.EOF
if Request.Form("courses") = oRs("CourseName") then 'if this is the selected one then display as selected
Response.Write ""
Response.Write oRs("CourseName") & ""
oRs.MoveNext
else
Response.Write ""
Response.Write oRs("CourseName") & ""
oRs.MoveNext
end if
loop
%>
If this small thing cant show database values, then Im mushed.If u got a dropdownlist project or sample I can use then please help me mate
kagiso
|
|
|
|
|
What happens when you try to connect ? Probably your connection string is broken
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It doesnt show any values.I have done this in VB.Net and worked but I need the page to show in vb.net as is now in HTML(Dreamweaver).
All Im want is to work on an existing page but try to open it in vb and add my own dropdown and have a database connection, but its giving me a problem as well.
kagiso
|
|
|
|
|
Hi,
I am using a coloured background for my windows form application. This is fine.
However some controls I am using - I am thinking of richtextbox and listboxes in particular insist on display scrollbars in the default windows colors which is frankly annoying.
This is a general question.
If I want to change the colors of the scollbar I am guesing I need to derive a new custom control with some kind of "on paint/draw event" method overide but (and here is my Big But)
1. I can inherit a class fine and I am guess a control is similar
In a class library application:
public class mylistbox
inherits listbox
etc.
How then do you get this into the toolbox in vs2005
2. In the overidden onPaint event I dont really know how to find the scrollbars and color them (as in no clue)
Could someone give me the theory of how to do the above in detail.
thanks
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!! anyone there!!!!!!!!!!!!!
yoohoo!!!!!!!!!!!
life is a bowl of cherries
go on take a byte
|
|
|
|
|
Hi
Everyone
I am tryin to store a password hash in my mysql user table
But i have been gettin a casting error, when I have been tryin to write to my database
Then i noticed the error in my ways, i had been using an example out of a book which uses sql server
and for starters i was tryin to cast an sql server dbtype into a mysql database
after changing from sqldbtype.binary, i changed it to mysqldbtype.binary, to discover that my current .net connector doesn't appear to support mysqldbtype.binary!
Any suggestions greatly appreciated
boy
|
|
|
|
|
Don't keep starting new threads on the same subject. Again, it makes it impossible to collaborate on an answer.
Try changing the field type to a variable length string, then encode the byte array to a Base64 string and store that in the database.
|
|
|
|
|
How do i change the field to variable length string?
Is that jus a varchar
without setting the size of field?
soz bit of a newb to this game
|
|
|
|
|
the var in varchar means that it's a variable length, the number is the maximum possible length. nvarchar is unicode, I believe, I tend to use nvarchar.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thank you christian
I tried to enter nvarchar into mySQL but it jus ended up changing it back to a varchar anyway
|
|
|
|
|
OK, mySQL is crap, perhaps it doesn't support both. Either way, that's a variable length string.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
the mysql connector doesn't seem to support a base64 string
What about an int64?
|
|
|
|
|
That's because you don't know what a Base64 encoding string is. It's an encoded stream of bytes that's most commonly used to send binary data in an email. Here, read this[^].
|
|
|
|
|
i have it working
this seemed to have done the trick
hashedBytes = shaHash.ComputeHash(encoder.GetBytes(txtPassword.Text))
Dim PWhash As String = encoder.GetString(hashedBytes)
param = cmdString.Parameters.Add("?p_Password", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = PWhash
|
|
|
|
|
Good morning evrybody
i'm wondring if someone can help me and show me how to configure the command objet of ADO.net and its requete to insert image into my database.
mydatabase (pictures) has one column "picture" with image type of sql server 2005.
thank you
my mail : dalidali184@yahoo.fr
DAli
|
|
|
|
|
Google for one of the million or so examples of this. All you have to type into Google is "vb.net sql server 2005 store image".
|
|
|
|
|
Could I get a Function Address in a Remote Process?
And how could I do?
|
|
|
|
|
You don't. The address would be meaningless on any machine other than the one the function is actually running on. So the question because, why would you even need it?
|
|
|
|
|
Now I have to use a API to do something.
It need a address of function, which in the third process.
|
|
|
|
|
Billypon wrote: It need a address of function, which in the third process.
Which won't do you any good because an address cannot be called on a remote machine. You can only give an API function an address on the LOCAL machine to call. You cannot give it an address on a remote machine. There's simply no way to represent that.
Now, you have to have a proxy running on the machines. On the local machine, the address you give the API function will be a delegate on the local machine in a proxy. This proxy marshals the call to a remote component that calls the real method on the remote. The API function won't know anything about the remote machine.
|
|
|
|
|
No!
It means both of the two process are run in the local machine which i say
|
|
|
|
|
It STILL won't do you any good because each process runs in it's own address space! Think of it this way. Each process thinks it's the only one running under Windows and has access to up to 2 GB's of RAM. The address you get for the function doesn't apply because it sits in a different address space.
|
|
|
|
|
i just wanna ask again, about what i posted last night... I am making a module for data entry of grades. But before that, i need first to search for the subjects before entering the grades of the students.
In clicking the search button, it should search a particular subject, then the datagrid should display all the students who enrolled in that subject that i will going to search.
I made a three database in access: 1. database of the students, 2. database of the different subjects. and
3. database of the students and the subjects they enroll.
How can I connect those three database to each other. The display of the datagrid should change if i search another subject. But i can't do it.
I use the OleDbDataAdapter. In the data adapter configuration wizard, will i choose those 3 database in the query builder so that it will be connected? Is this correct???
|
|
|
|
|
Uhhh, any particular reason why these are three seperate databases instead of just one database with 3 tables and a couple of relationships?
|
|
|
|
|
Because i am making a computerized grading system. But before that, i should first make a data entry of grades of each student enrolled in every subject they had enrolled.
So I made a separate database of the file maintenance of the all the students who enrolled. Then another database for all the subject offer in this semester with each corresponding proffesor in each subject. Then another database for the subjects that each of the students take.
In my module, i will going to search any subject offer, then the datagrid should display all the students who enroll in that subject. The display of the datagrid should also change if i will going to search another subject.
How can i make a query for that??? And how can i connect those database??? Is my module correct???
|
|
|
|