|
As you are creating the HTML already at server side.You have full control over the HTML what you have to show.Have some check at the time of creating table according to the data coming from DB. Set the rowspan.Check after the table is created,whether it is right or not.If not it means there is some problem in the creating the table. Cheers!!
Brij
|
|
|
|
|
I cant set my row span because it depends on the data retrieved from the database... Im not able to logically implement this requirement... Plz advice..
Thanx in advance,
Tash
|
|
|
|
|
<<tash18>> wrote: I cant set my row span because it depends on the data retrieved from the database...
Why, you just get the data from db, check how many records are there and where and howmauch rowsapn you need , you can decide if you are having data.Set it accordingly.You'll have to take decision of the count of rowspan after getting the data from DB. You can not hard code the rowspan.Cheers!!
Brij
|
|
|
|
|
The requirement is simply using 'control break logic'. Search for it.
Note that the sort order of the recordset is important.
Read the first record. Save the 'control break' (userid?, can be more than 1 value).
Write_All_Cells.
For every record after that...
Read.
If value same as saved 'control break' then
Write_Some_Cells (one td has a column span = n)
else
replace control break value
Write_All_Cells
|
|
|
|
|
Any sample code or articles plzz????
Thanx & regards,
Tash
|
|
|
|
|
|
Sorry im not able to cope with the replies posted here... I mean im not able to implement the logic... Im totally hit with it...
Any advice is appreciated...
Thanx in advance,
Tash
|
|
|
|
|
Yes, that whole logic thing will get you everytime.
Dim connection As New SqlConnection("server=MyServer;Trusted_Connection=true;database=MyDatabase")
connection.Open()
Dim command As New SqlCommand("select MyKey,MyField1,MyField2 from MyTable order by MyKey;", connection)
Dim reader As SqlDataReader = command.ExecuteReader()
Response.Write("<table border='1'>")
'Read the first record
reader.Read()
'Set the control break
Dim ControlBreak As Integer = CInt(reader(0))
'Write all cells
Response.Write("<tr><td>" & reader(0) & "</td><td>" & reader(1) & "</td><td>" & reader(2) & "</td></tr>")
While reader.Read()
If reader(0).Equals(ControlBreak) Then
'Write some cells
Response.Write("<tr><td colspan='2'> </td><td>" & reader(2) & "</td></tr>")
Else
'Reset the control break
ControlBreak = CInt(reader(0))
'Write all cells
Response.Write("<tr><td>" & reader(0) & "</td><td>" & reader(1) & "</td><td>" & reader(2) & "</td></tr>")
End If
End While
Response.Write("</table>")
reader.Close()
connection.Close()
|
|
|
|
|
Thanx for ur reply... but in my code i dont use reader i store it in a dataset.... so working on it.. Any advice is appreciated..
Thanx in advence..
Tash
|
|
|
|
|
Thanx a lot i found another solution for my issue.... actually i used the following code to solve it...
i used String collection to store the value and checked it and printed the table accordingly
ElseIf page = "UserApplication" Then
If DS.Tables(0).Rows.Count > 0 Then
InsertPageBreak()
InsertAppUserHeader()
Dim nfile As StringCollection = New StringCollection
Session("sc1") = nfile
For i = 0 To DS.Tables(0).Rows.Count - 1
PopulateAppUsrRow(DS.Tables(0).Rows(i)(0), DS.Tables(0).Rows(i)(1), DS.Tables(0).Rows(i)(2), DS.Tables(0).Rows(i)(3), DS.Tables(0).Rows(i)(4))
'DataSetToExcel.Convert(DS, Response)
Next
Now the Html table gets populated by the following code:
Public Sub PopulateAppUsrRow(ByVal Usrid As String, ByVal Usrname As String, ByVal Grpid As String, ByVal Grpdsc As String, ByVal FncDsc As String)
If Not Session("sc1").Contains(Usrid) Then
Session("sc1").Add(Usrid)
Response.Write("<tr><td align=left>" + Usrid + "</td><td align=left >" + Usrname + "</td><td align=left >" + Grpid + "</td><td align=left >" + Grpdsc + "</td><td align=left >" + FncDsc + "</td></tr>")
Else
Response.Write("<tr><td align=left> </td><td align=left >" + Usrname + "</td><td align=left >" + Grpid + "</td><td align=left >" + Grpdsc + "</td><td align=left >" + FncDsc + "</td></tr>")
End If
End Sub
Im happy with this kinda output.. any advice is appreciated...
Thanx in advance...
Tash
|
|
|
|
|
hi, iam using asp.net2.0 with c# with sql server
the table fields are as follows
username nvarchar
password nvarchar
emailid nvarchar
usertype int(1=administrator,2=programmer,3=manager,4=user)
active bit
so based on the user types how to give access on each page and on controls like buttons. and for different users different permissions .can you give me example which helps me
|
|
|
|
|
For this, when user login to application ,also retrieve the type of user say administrator etc and save the type of user in session.And on every pageload, you can just check the type of user and accordingly yoy can take decision which buttions/links you need to disabe/hide.
And if user goes direcly to the page which is not for it ,you can show "Access Denied" message.Cheers!!
Brij
|
|
|
|
|
how to give access permission on menu control using asp.net wit c#
give me example which helps me
|
|
|
|
|
|
iam using asp.net2.0 with c# with sql serever i want to store the employees details in the database which includes image of employee also so how to retrieve the image from database and display in image control
please give me suitabe solution which helps me
|
|
|
|
|
You can save the image path in database and store the image in physical location. So, when you are retreiving the from database, retreive the image path and then load the corresponding image from physical path.
You can have a look into this article as a ref.
Displaying Image in Gridview from Database[^]
Let me know if you need any help !Cheers !
Abhijit
Codeproject MVP
|
|
|
|
|
oh i dint see your post bro...
|
|
|
|
|
No Problem ! Cheers !
Abhijit
Codeproject MVP
|
|
|
|
|
store file name of image in db. and image in some folder in your application.
retrieving to image control..
image.imageurl="physical path where you hav stored images"...
LogoProject.ImageUrl = "~/test/" + id + "_" + img;
|
|
|
|
|
developerit wrote: please give me suitabe solution which helps me
Doesn't work like that: what happens is you try to work it out for yourself using the years of experience and knowledege you already have. Then when you are still stuck you come here and say 'This is what I have already tried: can you help me see where I am going wrong?'
In any case, if you googled you'd probably find a thoudand and one ways to do this.Tychotics
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
|
iam using asp.net2.0 with c#,in my website iam using
requiredfield validators and ajax controls. if iam entered any incorrect values in textboxes then i want to clear the text boxes then i have return the code for clearing the controls in clear button . but when i click clear button then validation controls and ajax validator calloutextenders is displaying and the textboxes are not clearing. how to solve this situations please give me example which helps me
|
|
|
|
|
set the
CausesValidation = "false" property of the clear button.
|
|
|
|
|
thanks it really helps...thanks for codeproject team
|
|
|
|
|
can anyone let me know how to use sql profiler 2005???
|
|
|
|