내 테이블 이름은 installation_status
이며삽입 값은
insallationid
의 값을 삽입하는 동시에 발언에 & 상태를 텍스트 상자에 값을 삽입하려면
installationid (fk)
remarks (varchar)
status (varchar)
같은 열이 포함되어 있습니다
(installation)column (installatioid(primary key,identity)).
나는이
installationid remarks status
73 asd xxx
과 같은 필요한 O/P 모양을 원하는 16,
값 73이 설치 테이블 열에서 얻을 수있다
installationid(primarykey(identity(1,1))
MMY .NET 코드는 필요한 얻을
PLS 나에게 도움/P O를 획득
con = New SqlConnection("server=(local)\sqlexpress;Database=service_request; Uid=service_request;Pwd=test123; ")
con.Open()
Try
Dim s2 As String
s2 = DropDownList4.SelectedItem.Value.ToString
cmd = New SqlCommand("insert into installation_status1 (status1,remarks)values('" + s2 + "','" + txtrmks.Text + "')", con)
cmd.ExecuteNonQuery()
cmd1 = New SqlCommand("INSERT INTO installation_status1 (installation_id)select installation_id FROM installation1", con)
cmd1.ExecuteNonQuery()
Catch ex As Exception
Lblmsg.Text = "error in recording the information: " + ex.Message
End Try
con.Close()
이
null asd xx
78 null null
을 좋아하다 o/p
피벗 쿼리가 필요합니다. BooksOnline에서 찾으십시오. – Asdfg
SQL 이해에 어려움을 겪고있는 것처럼 보입니다. 이는 세트 기반 언어입니다. 그것은 VB, C#, 그리고 많은 다른 언어와 같은 진보적 인 것이 아닙니다. 어떤 시점에서 installation1 테이블에는 많은 레코드가 있으므로 사용자가 특정 설치에 대한 새로운 installation_status1 레코드를 삽입하려고 할 때 응용 프로그램이 사용자가 어떤 설치에 대해 이야기하고 있는지를 어떻게 알 수 있습니까? 문제를 해결하기 위해 대답해야 할 주요 질문입니다. –