hii all,
Im doin a vb.net project... where i need to insert only 1 manager for 1 project location..
i already have managers and locations... and category id for the manager is 1.
i have 3 tables: tbl_staff_categories A
tbl_satff_assignments B
tbl_projects C
wherein...>>A.staff_id_pk=B.staff_id_fk =1
plz someone help..
thnx
6 1002
hii all,
Im doin a vb.net project... where i need to insert only 1 manager for 1 project location..
i already have managers and locations... and category id for the manager is 1.
i have 3 tables: tbl_staff_categories A
tbl_satff_assignments B
tbl_projects C
wherein...>>A.staff_id_pk=B.staff_id_fk =1
plz someone help..
thnx
Hi Rhepsi,
What have you tried so far to solve your problem?
Have you seen this .NET article on how to use a database in your program ?
-Frinny
Hi Rhepsi,
What have you tried so far to solve your problem?
Have you seen this .NET article on how to use a database in your program ?
-Frinny
thnx for ur reply..
i need to write this query using joins...
...>>>
Dim myselectquery As String = "SELECT pr_project_id_pk FROM tbl_projects WHERE pr_project_location= objListItem"
Dim myselectquerya As String = "SELECT sta_category_id_fk FROM tbl_staff_assignments WHERE sta_project_id_fk=tbl_projects.pr_project_id_pk"
.............>>>
joining these two queries...???
Dim sta_project_id_fk As Integer
If sta_project_id_fk = 1 Then
{
manager is available
}
end if
plz help..
thnx..
hepsi
thnx for ur reply..
i need to write this query using joins...
...>>>
Dim myselectquery As String = "SELECT pr_project_id_pk FROM tbl_projects WHERE pr_project_location= objListItem"
Dim myselectquerya As String = "SELECT sta_category_id_fk FROM tbl_staff_assignments WHERE sta_project_id_fk=tbl_projects.pr_project_id_pk"
.............>>>
joining these two queries...???
Dim sta_project_id_fk As Integer
If sta_project_id_fk = 1 Then
{
manager is available
}
end if
plz help..
thnx..
hepsi
If you're using MS SQL, have you tried using Query analyzer to test your SQL statements before using them in code?
Even if you're not using MS SQL, you should test your SQL commands before using them in your .NET code.
Are you sure this isn't a database question?
If you're using MS SQL, have you tried using Query analyzer to test your SQL statements before using them in code?
Even if you're not using MS SQL, you should test your SQL commands before using them in your .NET code.
Are you sure this isn't a database question?
hii, this is not a database question...
Have you any idea abt joining tables and combo box value.. ??
plz help..
thnx
hepsi.
hii, this is not a database question...
Have you any idea abt joining tables and combo box value.. ??
plz help..
thnx
hepsi.
That link on how to use a database gives a basic example of how to retrieve data from your database.
Once you have retrieved the data and have stored it into a DataRead, you will have to loop through all of the records in the DataReader and add them to your combo box (or drop down list).
For example you'll want to do something like: -
Dim dbCon As SqlConnection
-
dbCon = New SqlConnection(connectionString)
-
Dim sqlCom As New SqlCommand
-
sqlCom.Connection = dbCon
-
sqlcom.CommandType = CommandType.Text
-
-
sqlCom.CommandText = "Your String Containing Your SQL Select Statement"
-
-
'Add any parameters you need in order to execute the SQL statment successfully
-
'eg: sqlCom.Parameters.Add("@cID", SqlDbType.Int).Value = "1234567"
-
-
Try
-
Dim dr As SqlDataReader
-
dbCon.Open()
-
dr = sqlcom.ExecuteReader
-
-
If dr.HasRows = True Then
-
While dr.Read
-
theComboBox.Items.Add(New ListItem(ctype(dr(blabla),String),ctype(dr(blabla),String)))
-
End While
-
End If
-
-
dr.Close()
-
dbCon.Close()
-
-
Catch ex As Exception
-
-
End Try
-
*Please note that the above code will not work. It is just meant to be a guideline
-Frinny
That link on how to use a database gives a basic example of how to retrieve data from your database.
Once you have retrieved the data and have stored it into a DataRead, you will have to loop through all of the records in the DataReader and add them to your combo box (or drop down list).
For example you'll want to do something like: -
Dim dbCon As SqlConnection
-
dbCon = New SqlConnection(connectionString)
-
Dim sqlCom As New SqlCommand
-
sqlCom.Connection = dbCon
-
sqlcom.CommandType = CommandType.Text
-
-
sqlCom.CommandText = "Your String Containing Your SQL Select Statement"
-
-
'Add any parameters you need in order to execute the SQL statment successfully
-
'eg: sqlCom.Parameters.Add("@cID", SqlDbType.Int).Value = "1234567"
-
-
Try
-
Dim dr As SqlDataReader
-
dbCon.Open()
-
dr = sqlcom.ExecuteReader
-
-
If dr.HasRows = True Then
-
While dr.Read
-
theComboBox.Items.Add(New ListItem(ctype(dr(blabla),String),ctype(dr(blabla),String)))
-
End While
-
End If
-
-
dr.Close()
-
dbCon.Close()
-
-
Catch ex As Exception
-
-
End Try
-
*Please note that the above code will not work. It is just meant to be a guideline
-Frinny
thnx... itz been a gr8 help...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Adam Hearn |
last post by:
Sorry if this difficult to understand but I'm pulling my hair out and could
do with some good ideas please...
I've developed an application which in .NET as a Windows service which is
simply...
|
by: Andrei Ivanov |
last post by:
Hello,
it seems my postgresql data has somehow become corrupted (by a forced
shutdown I think):
psql template1 -U shadow
Password:
ERROR: nodeRead: did not find '}' at end of plan node...
|
by: Daniel |
last post by:
I use an Access database to basically take data exports, import them,
manipulate the data, and then turn them into exportable reports. I do
this using numerous macros, and queries to get the data...
|
by: Jim Heavey |
last post by:
Hello, I am running into something strange. I am getting the following error
when the program attempts to execute a particular procedure:
An unhandled exception of type...
|
by: S Anand |
last post by:
Is there any way to find out whether a record in the form is changed or not.
Say we are having a customer Form, where user can create or view customers.
When the user hits the Close/Exit icon, we...
|
by: rahman |
last post by:
I know it should be very easy but I am new in ASP so I could not
figured out.
Here is the simplified version of my code:
thePaymentID= request.querystring("IDValue")
SQLqueryPayment= "SELECT...
|
by: Martin R |
last post by:
Hi,
How to find first not null value in column whitout chacking whole table
(if there is a not null value then show me it and stop searching, the
table is quite big)?
thx,
Martin
*** Sent...
|
by: priya_sreejith |
last post by:
how can we find whether a particular SQL recordset is present or not using VB ?
|
by: john |
last post by:
In my form I have a master table and a details table linked 1xM. I can
search through the whole parent table but I also like to be able to search
through the child table fields to find parent...
|
by: busybeeitsme |
last post by:
hi friends
how to find the record no.. ie what is the location of the particular record in the database.. i dont hav any s.no column in my database.. if a particular record is retrived from the...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |