|
Use styleSheet class for headerTemplate
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
hi,
i have stylesheet for it:
.templateHeaderStyle
{
font-family:Arial;font-size:small; font-weight:normal;padding-left: 0.5em; text-decoration:none;
}
If i remove 'SortExpression' from:
<asp:TemplateField HeaderStyle-CssClass="templateHeaderStyle" HeaderText="<%$ Resources:Resource, AT_JobID_Text %>" SortExpression="JOB_OID" >
then the underline for column header doesn't come...but then sorting doesn't work....
i need it to sort the column based on "JOB_ID"...how do i do it?
kindly do guide me..thanks
|
|
|
|
|
which SQL query will be used to display the last added 4 or values, i want the recent values to b displaed into datagrid as the database i updated daily
|
|
|
|
|
SELECT TOP # [fields] FROM [table]
Replace # with the maximum number of records to return...
|
|
|
|
|
sir,
i think top # will give the first-n entries.
but the question was the last 4 addded records.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Sir,
I think you need to invert the order of your result set then...
ORDER BY Fieldname DESC
This will make sql sort the result set descending on field Fieldname and then pick the top 5 (which is then the latest 5)
|
|
|
|
|
Post your Question in the Suitable Forum.
SSK.
|
|
|
|
|
select top 5 * from table
use above query .it will work...
Mohammad Mustafa
|
|
|
|
|
hi friends
this is my stored procedure
CREATE procedure dbo.sp_ins_logo
@companyname varchar(120),
@country varchar(80),
@url varchar(150),
@category varchar(80),
@description varchar(250),
@picturepath varchar(80),
@picturetype char(5),
@status int,
@ins_status varchar(10) output,
@lcode varchar(10) output
as
set nocount on
begin transaction
declare @logo_rowid decimal
declare @logo_code varchar(10)
declare @logo_rowcount decimal
declare @max_logoid decimal
declare @logo_codepfix char(3)
set @logo_codepfix='LGO'
select @logo_rowcount= (select count(*) from dbo.tbladdlogos1)
if @logo_rowcount = 0
begin
select @logo_rowid = 1
select @logo_code = @logo_codepfix + convert(varchar(5),@logo_rowid)
end
else
begin
select @max_logoid = (select max(row_id) from dbo.tbladdlogos1)
set @logo_rowid = @max_logoid + 1
set @logo_code = @logo_codepfix + convert(varchar(5),@logo_rowid)
end
declare @file_name varchar(80)
set @file_name = @picturepath + @logo_code + '.' + @picturetype
if not exists (select companyname from dbo.tbladdlogos1 where url = @url)
begin
if not exists (select companyname from dbo.tbladdlogos1 where companyname = @companyname)
begin
insert into dbo.tbladdlogos1 values(@logo_rowid,@logo_code,@companyname,@country,@url,@category,@description,@file_name,@status)
declare @ER as int
select @ER = @@error
if @ER <> 0
begin
set @ins_status='Failure'
set @lcode=@logo_code
end
else
begin
set @ins_status='Success'
set @lcode=@logo_code
end
end
end
commit
GO
this is my codebehind
Try
Dim companyName, categoryName, countryName As String
Dim url, description, other, inFilename, fileType, path, ccategory As String
Dim status As Integer
companyName = txtcompany.Text
ccategory = txtcategory.Text
countryName = ddcountry.SelectedItem.Text
status = 0
url = txturl.Text
description = txtdescrip.Text
path = "images\logos\country\"
inFilename = myFile.PostedFile.FileName
fileType = inFilename.Substring((inFilename.IndexOf(".")) + 1, ((Len(inFilename)) - inFilename.IndexOf(".")) - 1)
strConnString = obj.GetConnectionString()
conn = obj.GetDbConnection(strConnString)
' create a sql comman using the query string and the DBconnection
myCommand = New SqlCommand("sp_ins_logo", conn)
myCommand.CommandType = CommandType.StoredProcedure
Dim objParam As SqlParameter
objParam = myCommand.Parameters.Add("@companyname", SqlDbType.VarChar, 120)
objParam.Direction = ParameterDirection.Input
objParam.Value = companyName
objParam = myCommand.Parameters.Add("@country", SqlDbType.VarChar, 80)
objParam.Direction = ParameterDirection.Input
objParam.Value = countryName
objParam = myCommand.Parameters.Add("@url", SqlDbType.VarChar, 150)
objParam.Direction = ParameterDirection.Input
objParam.Value = url
objParam = myCommand.Parameters.Add("@category", SqlDbType.VarChar, 80)
objParam.Direction = ParameterDirection.Input
objParam.Value = ccategory
objParam = myCommand.Parameters.Add("@description", SqlDbType.VarChar, 250)
objParam.Direction = ParameterDirection.Input
objParam.Value = description
objParam = myCommand.Parameters.Add("@picturepath", SqlDbType.VarChar, 80)
objParam.Direction = ParameterDirection.Input
objParam.Value = path
objParam = myCommand.Parameters.Add("@picturetype", SqlDbType.Char, 5)
objParam.Direction = ParameterDirection.Input
objParam.Value = fileType
objParam = myCommand.Parameters.Add("@status", SqlDbType.Int)
objParam.Direction = ParameterDirection.Input
objParam.Value = status
objParam = myCommand.Parameters.Add("@ins_status", SqlDbType.VarChar, 10)
objParam.Direction = ParameterDirection.Output
objParam = myCommand.Parameters.Add("@lcode", SqlDbType.VarChar, 10)
objParam.Direction = ParameterDirection.Output
myCommand.ExecuteNonQuery()
Dim insStatus, insCode As String
insStatus = myCommand.Parameters("@ins_status").Value
insCode = myCommand.Parameters("@lcode").Value
If insStatus = "Success" Then
Dim statusOutput As String
If statusOutput = "Success" Then
lblMsg.Visible = True
lblMsg.ForeColor = Color.DarkGreen
lblMsg.Text = "Your Logo was uploaded successfully."
Else
Dim delQuery As String
delQuery = "delete from tbladdlogos1 where logo_code='" & insCode & "'"
myCommand = New SqlCommand(delQuery, conn)
myCommand.ExecuteNonQuery()
lblMsg.ForeColor = Color.Red
lblMsg.Text = statusOutput
End If
ElseIf insStatus = Nothing Then
lblMsg.ForeColor = Color.Red
lblMsg.Text = "Problem in uploadig your Logo, Please Try again Later..!"
Else
lblMsg.ForeColor = Color.Red
lblMsg.Text = "you have already uploaded the logo for this comapny"
End If
Catch ex As Exception
Response.Write(ex.Message)
Finally
If (Not conn Is Nothing) Then
' objCsDataBase.CloseDbConnection(conn)
End If
End Try
End Sub
my problem is:
I have four texboxs
1.company name
2.url
3.category
4.description
5.fileupload
here ,i wrote the storedprocdure the users entered the company one time only
next time he entered same comapany the "you have already uploaded the logo for this comapny" this text is displayed
but i entered next time i got error like this
"Cast from type 'DBNull' to type 'String' is not valid"
plz help me
regards
saravanan
|
|
|
|
|
the value (which can be also NULL) from the database to a function, which accepts a string, then you will get such an error.
Cast from type 'DBNull' to type 'String' is not valid.
To get this working you will have to pass the value as an object. That means the function must simply accept it as an object instead of a string.
SSK.
|
|
|
|
|
sorry
i didn't understand
regards
saravanan
|
|
|
|
|
Try to set the Break points and check whether you get the value from the DB or it is null.
SSK.
|
|
|
|
|
break point skip this line
insStatus = myCommand.Parameters("@ins_status").Value
regards
saravanan
|
|
|
|
|
I want the client to be able to drag and drop thumbnail images in the context of the web page
can it is possible ?
waiting for hopfully reply...
|
|
|
|
|
its possible.
you can try ajaxcontrol toolkit in ajaxasp.net
or
you can write your own code for drag and drop of the div elements.
images must be with in the div element.
search the web for div drag and drop. you will get lot of resources for it.
All The Best
Sathesh Pandian
|
|
|
|
|
Hi all,
Can any one plz tell me how to convert a Aspx page into Ajax enabled page.
I have installed the Ajax framework.I have even tried it adding the tag <sript manager="">
|
|
|
|
|
Just u have to need to change webconfig file.
copy webconfig file of AjaxEnable application and paste it in ASPX page application
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Thanks a lot will try this..
|
|
|
|
|
you have to add some configuration tags in web.config. Thats little risky to check it out each and everything.
So what you have to do is, open an ajax enabled website, then copy the content from web.config of the ajax-enabled website and paste it in your application's web.config.
Hope this will work
Regards,
Sylvester G
If we don't succeed, we run the risk of failure
|
|
|
|
|
Hi Friends,
I have a Folder in root directory of my application "MeetingID"
Now i want to create a Folder ("Referance") in the above Folder;How can i do this at code behind ?????
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
Directory.CreateDirectory(YourDirectoryName)
|
|
|
|
|
Thanks
Go the Solution,
Actually i was doing the same but i did not specified the Directory name.
Anyways Thanx.
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
Hi all
I need to Enable & disable AutopostBAck at client side.
Iam using this code but is not working:
<br />
'On code behind page<br />
ddlBusinessLinesL1.Attributes.Add("onchange", "javascript:return DisableBLPostBack('" & ddlBusinessLinesL1.ClientID & "','" & ddlReportType.ClientID & "')")<br />
<br />
'the javascript<br />
function DisableBLPostBack(ddlb,rpType)<br />
{<br />
var ddlbus=document.getElementById(ddlb);<br />
var ddl=document.getElementById(rpType);<br />
alert(ddlbus.id);<br />
if (ddl.value==1)<br />
{<br />
alert('false');<br />
return false;<br />
}<br />
else <br />
{<br />
alert('true');<br />
return true;<br />
} <br />
}<br />
Any help, this is urgent for me.
|
|
|
|