hi,
i have three tables named types,books,artcles
types consist of books,artcles
books consist of title,authorname,userid(means book title and author of the book)
articles consist of title,authorname,userid(means articletitle and author of the article)
i have a datagrid ...names of the columns are in the datagrid is
type,userid,title,author
if he enters the data in the book.the type should be book and the book title should come in the title column along with userid and author name in the respective columns.
and same for article also.
how can i write the query for" if it is book,then in the title column book title has to come" in the datagrid
how can i write the query for" if it is article,in the title column article title has to come" in the datagrid
and howe can i bind this to datagrid
1 1229
hi,
i have three tables named types,books,artcles
types consist of books,artcles
books consist of title,authorname,userid(means book title and author of the book)
articles consist of title,authorname,userid(means articletitle and author of the article)
i have a datagrid ...names of the columns are in the datagrid is
type,userid,title,author
if he enters the data in the book.the type should be book and the book title should come in the title column along with userid and author name in the respective columns.
and same for article also.
how can i write the query for" if it is book,then in the title column book title has to come" in the datagrid
how can i write the query for" if it is article,in the title column article title has to come" in the datagrid
and howe can i bind this to datagrid
I dont think you are very much clear about your requirement......
Tell me who will chhose the type??
From where the type will be chosen???
I suggest you the following......
Take a combobox to choose type.....On SelectedIndexChanged event of the combobox set your sql query like this.... - Dim cType as String
-
Dim strSql as String
-
Select Case cType
-
Case "Book"
-
strSql ="SELECT title,authorname,userid FROM book"
-
Case "Article"
-
strSql ="SELECT title,authorname,userid FROM article"
-
End Select
-
now execute the query......fill a dataset...and bind your grid with this dataset......or altenatively you can use a datareader too...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jim |
last post by:
I need some help getting started with a .NET web project for a
commercial site. I am new to .NET and my understanding of some (but
not all) of its concepts is a little sparse. I apologize for the...
|
by: Jim |
last post by:
This si a repost, I apologize but perhaps my original inquiry got
buried under all the usenet spam...
I need some help getting started with a .NET web project for a
commercial site. I am new to...
|
by: Joe |
last post by:
Hi All,
I am new to using the Access DB and I need some help if someone
is able to give it to me. What I want to do is get the names of
the columns of certain tables. Not the data in the table...
|
by: pb648174 |
last post by:
In a multi-user environment, I would like to get a list of Ids
generated, similar to:
declare @LastId int
select @LastId = Max(Id) From TableMania
INSERT INTO TableMania (ColumnA, ColumnB)...
|
by: Lennart Anderson |
last post by:
I'm having a MySQl table wih a lot of information. I want to present some
main fields in a table on one page. Each record do, of course, have a unique
ID. The presnted table will have one field as...
|
by: sgottenyc |
last post by:
Hello,
If you could assist me with the following situation, I would be very
grateful.
I have a table of data retrieved from database displayed on screen.
To each row of data, I have added...
|
by: JamesB |
last post by:
I am writing a service that monitors when a particular app is started.
Works, but I need to get the user who is currently logged in, and of course
Environment.UserName returns the service logon...
|
by: sathyashrayan |
last post by:
Dear Group,
Please look at the following demo link.
http://www.itsravi.com/demo/new_pms/admin/addproject.php
|
by: rustyc |
last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-)
As I said over there:
... for a little side project at home, I'm writing a ham radio web site in...
|
by: Rahul Babbar |
last post by:
Hi,
I am getting the following error, while executing the simple insert
script on a few tables.
INSERT INTO <table_name>(<col1>) VALUES (1);
DB2 SQL error: SQLCODE: -440, SQLSTATE: 42884,...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
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: 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...
| |