SQL: mutiple rows one column to multiple columns one rowIn InfoMaker SQL can you take a table with multiple
rows for the same key and take a column from the
rows and create mutiple columns with one
report line with the key(no duplicate keys) on a report? For example
Table books
(key) (book title)
123 misery
123 titanic
123 roots
456 war
456 1984
456 giant
The report I need would look like this
Key title1 title2 title 3
123 misery titanic roots
456 war 1984 giant
Thanks in advance.
--
Kaye Hendry
HealthInsight
email:kaye.hendry@healthinsight.org
...
Problem with updating only one row in a SQL 2005 database
hi,
I have a problem with updating a row in my database. I don't know how to update and i need help.
I have a form where the users select a category and a sub category to enter a message.
I have two dropdown lists, one is for selecting the category and the other is for the sub-category.
In my database for the categories and the sub-categories, i have a variable (Quantity) where i keep the quantity for each table.
I just want to be able to increment this variable by 1 (for the selected category and sub-category) when a user enter a new message...
The insert procedure is working well and...
Return value for one selected row from a SQL database/Dataset problem
I try to get a value from ArtikkelId from a SQL database into a textbox. Can anyone help me?
My Code-----------------------------------------
Imports System.DataImports System.Data.SqlClient
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Conn_News_db As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("NEWS_CS1").ToString()Dim SQL_conn As New SqlConnection(Conn_News_db)Dim SQL_cmd1 As New SqlCommand()Dim myDataSet As New DataSetDim Select_ArtId_Max As String = "Select ArtikkelId from Hoved where A...
SQL Problem
I am having a problem when uploading image data into SQL... The following statement correctly inserts the data into the SQL database: (database connection declaration...) commInsertImage = New SqlCommand( _ "INSERT INTO [Images] ([Title], [MIMEType], [ImageData]) VALUES (@Title, @MIMEType, @ImageData) " & _ "SELECT SCOPE_IDENTITY() As ImageID", conn)(...Varible declarations...) conn.Open()
 ...
How to read a dataset one row by one row?
I know you can use DataSet after close sql connection.
I want to something after getting dataset, read from one row by one row, just like while datareader.read()
Can I read dataset just like this?
Thanks in advance!
Justin
Is this what you're looking for (from the Tips and Tricks Section of ASPNet101.com):http://aspnet101.com/aspnet101/tips.aspx?id=175David WierMCP/ASPInsiderASPNet101.com - where to look first!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(Please 'Mark as Answer&...
SQL beginners problem !
*** edited by: master4eva ***
Please enclose your code in < code ></ code> tags (without the spaces). This will make your code easier to read online; therefore, encouraging a response to be faster. It is to your own benefit for your question to be answered in future.
I have already done the editing to include the < code ></ code> tags for this post.
*********
Hi,
I am following tutorials in a book to try and implememnt a basic select query using SQL.
However i am following all the instructions, which includes entering this header:
<%@ Page La...
2 gridviews on one row, problem with render for double click function on a grdiview row
Hi,
I have an application with 2 gridviews on one page. On the first gridview (GridViewRequests) I have a function to double click on a row, when I double click a detail screen opens where I can edit the data of the selected row. Now I want the samen function on my second gridview (GridView1). I was thinking this should go easy because I can simply copy the code from the first function en change the names to my second gridview. But I have a piece of code which I can't duplicate. Can I solve this in another way?? It's this code:
Protected Overrides Sub Render(ByVal writer As HtmlTex...
is it possible to turn 1 column,many rows into one row,many columns in sql ?
Hi AllI have the following query:Select CategoryName From Category Where CategoryId In(Select SkillId From SpecialitySkills Where CopywriterId = 13) It gives me the correct results but not in the form that i want, i would like it to be in one row, many columns. its in 1 column, many rows.Any ideas?
You must be talking about displaying it on a web page? Just create a loop that runs through the rows of the data that is returned then just make html table:dim tablestring as string = "<table><tr>" for i as integer = 0 to dt.rows.count - 1 tablestring += &...
Sql problem one more timeI used:
select d.name from sysdevices d, sysusages u where u.vstart between d.low
and d.high and u.dbid = db_id("mat") go
and it works and I've got a name of the device (or devices) but i need one
more thing:
I want to know on what device is data and on what device is log (if a
database have logs and data on separate devices)
Please help me one more time
Thanks a lot
Mat - mfinch@o2.pl
select segmap from sysusages. a segmap of 3 is data and a segmap of 4 is
log. If you have user defined segments for a particular database you will
see other values for s...
One SQL db allowed problem
Hi
I'm just about to deploy my website. I've signed up to a web host that allows me 1 SQL server db.
However, i've just realized that in order to provide login etc, VS has added another SQL db - 'ASPNETDB.MDF'.
So, I now have 2 databases but my ISP only allows me to host one.
Is it OK for me to add my 'Customer' database tables to the 'ASPNETDB.MDF' to solve this problem?
Thanks!
You can merge your two databases together. Actually, I would create all objects of ASPNETDB in my database to start.Limno
Do you mean that I should...
Inserting Multiple Rows in One SQL
Hi, would like to know if there are any links or sample code to learn how to Insert multiple rows with 1 sql statement.Also, can the inserted values' source be from a table in another database table or from a dataset?I am actually trying to insert about 117 rows of data.Table 1======UID Primary Key TeamCode a code value representing different teams Week will equal to 2Points &n...
SQL database rows count problem..
i am using Sql Server database and i am trying to count the total rows... but it always say 0 rows please help me
i have this on my page load:
Dim objProduct As New Product
gvproduct.DataSource = objCat.GetProducts()
gvproduct.DataBind()
lblrows.Text = objProduct.rowscount
i have this on my class file Product.vb
Public rowscount as integer
Public Function GetProducts() As DataSet
Dim strConn As StringstrConn = ConfigurationManager.ConnectionStrings("StellarBookstoreConnectionString").ToString
Dim conn As New SqlConnection(strConn)
' Retrieve p...
how to drag and drop one row from one datawindow and update the exist row in other datawindow ?I liked to drag and drop a field (assume: name) from a row of one
datawindow (dw_1) to another datawindow (dw_2), and also update the
exist row in dw_2.
Thanks for help.
--
Best regards,
Ridwan
Goldbase Technology
Visit our Homepage :
http://www.geocities.com/Wallstreet/Floor/5251/index.html
http://members.tripod.com/goldbase
http://members.xoom.com/goldbase
* Check out the Y2K (Year 2000 Problems - Millenium Bugs)
Take a look at the Drag Drop entries in the help file.
Basically, you need to turn on Dragging using Drag(Begin!).
When you drop onto dw_2, the drag...
Reduce rows displayed but putting 3 rows in one rowHi all,
I'm using PB6.5. I have an SQL DW that fetch some
information from the DB but should display only two columns:
a code and a value. Also they are displayed in the trailer
of a group if that's actually important.
In order to reduce displayed rows count, i would like to
display each 3 rows in one
row(Code,Value,Code,Value,Code,Value).
The question is how can i do that?.
I've tried to use computed fields and in the second and
third pair values to use code[1],value[1],code[2],value[2]
but only the code[1],value[1] are OK(Showing next row's
data), the third ...
selecting one row and inserting it into another table one by one
i ve a table named "Employee" in wh i ve fields "Emp_Id","Name" and "Email". i want to select each employee "Emp_Id" one by one from "Employee" table and insert it into another table named "Concerned_Department". like if i ve three rows in "Employee" table with "Emp_Id" 1,2 and 3 respectively,in this case i want to first select "Emp_Id"=1 then "Emp_id"=2 and lastly "Emp_id"=3 and insert them into "Concerned_Department"table.
after that the process star...