Click here to Skip to main content
15,897,704 members

Comments by Sarita B Patil (Top 5 by date)

Sarita B Patil 12-Mar-19 1:01am View    
I want to pass csv values to HTTP API as a parameter.
so can you help me, how to do this in c#
Sarita B Patil 2-Nov-18 1:17am View    
When I am converting image via the app, it gets uploaded in my another application. But when I am converting programmatically, it didn't get upload.
Can we find the version of tiff image file?
Sarita B Patil 1-Nov-18 4:36am View    
Try This

CREATE TABLE [dbo].[StudentMaster](
[StudentId] [numeric](18, 0) NOT NULL,
[StudentName] [varchar](50) NULL
) ON [PRIMARY]

GO
INSERT INTO StudentMaster(StudentID, StudentName) VALUES (1,'Garry')
INSERT INTO StudentMaster(StudentID, StudentName) VALUES (2,'Alex')
INSERT INTO StudentMaster(StudentID, StudentName) VALUES (3,'Sam')
INSERT INTO StudentMaster(StudentID, StudentName) VALUES (4,'Paul')
INSERT INTO StudentMaster(StudentID, StudentName) VALUES (5,'Ben')
SELECT * FROM StudentMaster
GO

CREATE TABLE [dbo].[Courses](
[CourseID] [int] NOT NULL,
[CourseName] [nvarchar](20) NULL,
PRIMARY KEY CLUSTERED
(
[CourseID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

INSERT INTO Courses(CourseId,CourseName) VALUES (1,'C#')
INSERT INTO Courses(CourseId,CourseName) VALUES (2,'ASP.Net')
INSERT INTO Courses(CourseId,CourseName) VALUES (3,'MVC')
INSERT INTO Courses(CourseId,CourseName) VALUES (4,'WCF')
INSERT INTO Courses(CourseId,CourseName) VALUES (5,'Share Point')
INSERT INTO Courses(CourseId,CourseName) VALUES (6,'WPF')
INSERT INTO Courses(CourseId,CourseName) VALUES (7,'SQL Server')
INSERT INTO Courses(CourseId,CourseName) VALUES (8,'JQuery')
SELECT * FROM Courses

GO

CREATE TABLE [dbo].[StudentCourses](
[StudentID] [int] NULL,
[CourseID] [int] NULL
) ON [PRIMARY]

GO

INSERT INTO StudentCourses(StudentID, CourseID) VALUES (1,1)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (1,3)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (1,5)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (2,2)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (2,4)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (2,5)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (3,3)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (3,6)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (4,7)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (4,8)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (5,1)
INSERT INTO StudentCourses(StudentID, CourseID) VALUES (5,2)
SELECT * FROM StudentCourses




select t11.StudentID,StudentMaster.StudentName,t11.CourseNames from
(SELECT StudentID,
CourseNames=STUFF
(
(
SELECT DISTINCT ', '+ CAST(g.CourseName AS VARCHAR(MAX))
FROM Courses g,StudentCourses e
WHERE g.CourseID=e.CourseID and e.StudentID=t1.StudentID
FOR XMl PATH('')
),1,1,''
)
FROM StudentCourses t1
GROUP BY StudentID ) as t11
INNER JOIN StudentMaster ON StudentMaster.StudentID = t11.StudentID


Output will as follows : -

StudentID StudentName CourseNames
1 Garry C#, MVC, Share Point
2 Alex ASP.Net, Share Point, WCF
3 Sam MVC, WPF
4 Paul JQuery, SQL Server
5 Ben ASP.Net, C#
Sarita B Patil 31-Oct-18 1:04am View    
Because there is a problem in viewing image.
Sarita B Patil 31-Oct-18 1:00am View    
I want the code in the console application or web application using c#.