|
I got a question here..
If Im using sql server 2005 database..
would da OleDb can be used and the code stil the same except the connection string?
Im js a beginner.
Thanks a lot
Life is up and down
Nevertheless,never give up hope and be confident to yourself
|
|
|
|
|
I have tried the code but I got a runtime error as belo
"Error 2 Type 'System.Data.SqlClient.SqlDataReader' has no constructors. C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\CinemaTicketing\CinemaTicketing\MainPage.vb 39 13 CinemaTicketing"
What does it mean by no instructor??
Life is up and down
Nevertheless,never give up hope and be confident to yourself
|
|
|
|
|
kc_renji wrote: What does it mean by no instructor?
Read the error message again. It's talking about a constructor, not an instructor.
You can't create an SqlDataReader object by using the new keyword, as there is no public constructor that can be use for that. A data reader is created using the command object by calling the ExecuteReader method.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Thanks.I have corrected it.
Life is up and down
Nevertheless,never give up hope and be confident to yourself
|
|
|
|
|
There are converters on the web that will do this for you. None of them are perfect, but they can get pretty close.
Really, what you posted is very easy to convert. All you have to do is look at any of the code samples on MSDN and they'll show you a piece of VB.NET and the equivilent C# code. Just look at the patterns of each line and you'll see that the majority of code converts quite easily.
|
|
|
|
|
Dave Kreskowiak wrote: There are converters on the web that will do this for you.
Yes it is. I sense the OP is just being lazy ( he ought to learn C# if he doesn't know it )...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
i am using vb.net to create an application for maintenance of records for a company.i am using ms access as db and am also using datagrid to view the data from the db.
i have used a primary key in all the tables..
how do i check if a record having the same values in all the fields except the primary key(of course) is being entered twice or more?
i am new to .net and urgently need help..
god bless........
-- modified at 11:26 Friday 26th October, 2007
|
|
|
|
|
anniie wrote: i have used a primary key in all the tables
On which column you have assigned the Primary key. What is exactly the structure of your Table.
AliAmjad(MCP)
|
|
|
|
|
You would have to perform an SQL SELECT query on the table looking for a record with all those fields set already. If you get anything other than 0 records back, either something went wrong in the search, or there is already a record with those details in it.
|
|
|
|
|
thx 4 the reply to both of you..
Also,..Dave..can you elaborate on the SQL SELECT query please..?
ie could you give an example?
i think that this might help..
i have a table emp_pc (with pc_no as PK) in which all the PC's assigned to the employees are maintained..
suppose that i assigned PC001 to EMP1..how do i avoid entering another record in which PC001 is assigned to EMP1?
-- modified at 9:07 Saturday 27th October, 2007
god bless
|
|
|
|
|
There isn't enough information to write the statement. Do you have two tables holding data?? Is there a relationship between them?? What do the tables' schemas look like?? What columns are these two pieces of information in (PC001 and EMP1)??
|
|
|
|
|
I'm going to go out on a limb and assume that you have three tables:
emp:
emp_no - PK
emp_name
etc.
pc:
pc_no - PK
etc.
emp_pc:
emp_no - FK to emp.emp_no
pc_no - FK to pc.pc_no, unique
The primary key on emp_pc would be (emp_no, pc_no), you would also create a unique index on pc_no (because a pc can only be assigned to one employee)
Cheers,
Jason Lepack
|
|
|
|
|
I need to read 4 hexadecimal chars from a textbox and put them into a Uint
how can I do that?
BiG RaLpH
|
|
|
|
|
Don't cross post in multiple forums. It's unecessary and make it difficult for people to collaborate on an answer.
|
|
|
|
|
i have been messing with vb for about 3 months now and i am trying to find the code to where you can click browse and you can search you pc for the file you want then it loads the file to a datagrid, i have tried my own code and alot of others form the net but all give build errors and i cant seen to fix them.
can someone please link me to or tell me the cod that allows you to search for certain files and load them to a data grid.
-Chris
|
|
|
|
|
FreakNikon wrote: have been messing with vb for about 3 months now and i am trying to find the code to where you can click browse and you can search you pc for the file you want then it loads the file to a datagrid
What kind of file you are trying to display in the Datagrid? Datagrid is for displaying the records from a database. You can use Dataset for this purpose. Or you can also display a CSV file in the datagrid.
AliAmjad(MCP)
|
|
|
|
|
well lets say im trying to load a text fie into a datagrid. what would i put to load the file into the datagrid
|
|
|
|
|
I was wondering if this was possible....i know i can use a VB Variable in javascript using <%= strRandom %>. But it doesn't seem as easy to pass a javascript variable to a VB variable.
|
|
|
|
|
You can't. They are two entirely different runtimes that don't know anything about each other and provide no methods for communication between them. What you're doing in your code example is actually replacing the <%...%> tag with the value of the variable in the HTML. The Java code doesn't even know VBScript exists.
|
|
|
|
|
Yeah, I just used a hidden object to store the value and take it from that.
But thanks for the reply
|
|
|
|
|
I have a question... I have a datagrid populated with a large list of information. I have a text box above the datagrid and i want it to be possible for the user to click inside the textbox and type a letter and the list jumps to the row on the datagrid beginning with that letter. As the user continues typing in letters it brings matches up to the item on the list that most closly matches what is being typed.
The way I have it now is that the user can type in a word and it finds that row in the datagrid. I want it to match up to the letter. any clues?
This code is what i have now...it finds the item by number or acronym typed in the text box but you have to type in the whole number or acronym...not just one letter.
Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged<br />
Dim intItemFound As Integer<br />
This will search the programlist for whatever the user is inputting in the textbox<br />
If Me.rbAcronym.Checked = True Then<br />
intItemFound = Me.m_bndProgramList.Find("REVISION_ACRONYM", txtSearch.Text)<br />
Me.m_bndProgramList.Position = intItemFound<br />
ElseIf Me.rbNumber.Checked = True Then<br />
intItemFound = Me.m_bndProgramList.Find("BASE_PROGRAM_NUMBER", txtSearch.Text)<br />
Me.m_bndProgramList.Position = intItemFound<br />
End If
Erica
|
|
|
|
|
The Find method doesn't support wildcards and will match onlt the entire search string, case-insensitive.
If you want to narrow down what the user sees, then you can use the Filter property of the BindingSource and use something like:
Me.m_bndProgramList.Filter = String.Format("REVISION_ACRONYM LIKE '{0}%'", txtSearch.Text)
This will return all of the records that have a value in the REVISION... column that starts with the text entered in the TextBox.
|
|
|
|
|
thank you soooooo much. Now it does exactly what I want...YAY
Erica
|
|
|
|
|
I have a series of windows that have windows inside and I wish to lock them together so if the outer window is expanded the inner window will follow.
|
|
|
|
|
Handle the Resize event of the outer window. In there, calculate the new size of the child windows appropriately for your situation and set the Size property of the child windows.
|
|
|
|