|
I do all that function in click of a button.
the code will be some thing like this
Generatereport();
GenerateFiles();
UpdateDatabase();
I created a scriptmanager and then a updatepanel and then added a label into the update panel.
then i changed the code like this
lbl1.Text="Updating reports";
Generatereport();
lbl1.Text="Updating Files";
GenerateFiles();
lbl1.Text="Updating Database";
UpdateDatabase();
This does not work, the code executes completely and the final label value is displayed.
|
|
|
|
|
I've a some TextFields & a asp button in ajax accordion content pane. It doesn't work when I click button; an error arises onClick: button1_Click in C# code.
error:No overload for 'btnBasicInfo_Click' matches delegate 'System.EventHandler'
asp:Button ID="btnBasicInfo" runat="server" Text="Save" OnClick="btnBasicInfo_Click"
modified on Wednesday, June 3, 2009 1:37 AM
|
|
|
|
|
arif.ict87 wrote: an error arises onClick: button1_Click in C# code.
What is the Error ?
|
|
|
|
|
i have datatable in which 2 row,1st column value is null
that column is datatype is DateTime.
wwhen i tried to add data to database..its gives me error as
Object cannot be cast from DBNull to other types.
i have done following..
foreach (DataRow dtRow in dtTrackingData.Rows)
{
SqlHelper.ExecuteNonQuery
(
myConnectionString
, "SP_NAME"
, iWeekNo
, Convert.ToInt32(dtRow["InvCoID"])
, Convert.ToDateTime(dtRow["LatestReportDateConsensus"])
, Convert.ToDateTime(dtRow["LatestReportDateVirtua"])
,dtFromDate
,dtToDate
,CreatedBy
);
}
i tried to add
if (dtRow["LatestReportDateConsensus"] == System.DBNull.Value)
dtRow["LatestReportDateConsensus"] =null;
still its not work..
how i will add value to datarow if its null
modified on Wednesday, June 3, 2009 1:22 AM
|
|
|
|
|
try using the following code :
foreach (DataRow dtRow in dtTrackingData.Rows)
{
SqlHelper.ExecuteNonQuery
(
myConnectionString
, "SP_NAME"
, iWeekNo
, Convert.ToInt32(dtRow["InvCoID"])
, IIF(IsDBNull(dtRow["LatestReportDateConsensus"]), "null" , dtRow["LatestReportDateConsensus"] )
, Convert.ToDateTime(dtRow["LatestReportDateVirtua"])
,dtFromDate
,dtToDate
,CreatedBy
);
}
i have used IIF function; it checks if datevalue is true for dbnull then adds null in database else the datevalue of datatable column
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
didnt get that IIF
whts tht??
|
|
|
|
|
IIF is in vb.net
for C# its ((what) ? then : else)
Apologies for the goof up
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
my code is in C#..

|
|
|
|
|
google for ((what) ? then : else) C#
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
search lottttttt
but no success.. 
|
|
|
|
|
got the solution...............
SqlHelper.ExecuteNonQuery
(
myConnectionString
, "usp_InsertTrackingData"
, iWeekNo
, Convert.ToInt32(dtRow["InvCoID"])
, ((dtRow["LatestReportDateConsensus"] != DBNull.Value) ? dtRow["LatestReportDateConsensus"] : null)
, ((dtRow["LatestReportDateVirtua"] != DBNull.Value) ? dtRow["LatestReportDateVirtua"] : null)
,dtFromDate
,dtToDate
,CreatedBy
);
|
|
|
|
|
Friends
I had developed an small website in visualstudio 2008
and I had problem in Deployment of that site..
steps:
1.I installed IIS server
2.registered asp.net
3.Created virtual directary and placed in that folder
It is working in One System with
URL:http://localhost/home.aspx
I want that site to be run in the LAN systems
I am using XPsp2
came out of hardwork
|
|
|
|
|
What is your problem exactly ? If it has to run on the LAN, just replace localhost with the name of the machine. You understand what 'localhost' means, right ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
kumarjammula wrote: It is working in One System with
URL:http://localhost/home.aspx
I want that site to be run in the LAN systems
Its means its working in the machine where you have deployed. Now Try to access it from other machine with the IP Address of the deployed system like http://192.192.192.192/home.aspx
Make sure that system should have the same LAN.
kumarjammula wrote: 3.Created virtual directary and placed in that folder
BTW : one question, you have wrote you have create the Virtual Directory, What is your Virtual Directory name? If you have the Virtual directory you should access it from http://localhost/<Virtual Directory>/Home.aspx Or you are redirecting your site from Root to any where?
|
|
|
|
|
Hi all,
Can any one tell me how to export the data from datatable to excel without using Microsoft.office.tools.....
and formating the cells in the excel like in one cell entering 2-3 values etc.
Thanks in advance..
|
|
|
|
|
sarangkhandare wrote: Can any one tell me how to export the data from datatable to excel
Have a look
sarangkhandare wrote: formating the cells in the excel like in one cell entering 2-3 values
I don't understand this point. Can you be please more specific?
Thank you!
|
|
|
|
|
give a linkbutton "export to excel" and do the following code on its click event
Dim Grid As New System.Web.UI.WebControls.GridView
Try
Grid.AutoGenerateColumns = True
Grid.RowStyle.Wrap = True
Grid.AlternatingRowStyle.Wrap = True
Grid.DataSource = [YOUR DATASET]
Grid.DataBind()
-- header style required by you for excel
Grid.HeaderRow.Cells(0).Width = 200
Grid.HeaderRow.Style("font-family") = "Verdana"
Grid.HeaderRow.Style("font-size") = "12px"
Grid.HeaderRow.Font.Bold = True
Grid.HeaderRow.ForeColor = Color.White
Grid.HeaderRow.BackColor = Color.Blue
For Each row As System.Web.UI.WebControls.GridViewRow In Grid.Rows
-- row style required by you for excel
row.Cells(0).Width = 100
row.Style("font-family") = "Verdana"
row.Style("font-size") = "12px"
row.Style("text-align") = "left"
Next
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=" & [YOUR PREFERRED FILE NAME] & ".xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.xls"
Dim stringWrite As New System.IO.StringWriter()
Dim htmlWrite As New HtmlTextWriter(stringWrite)
Grid.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.End()
Catch ex As Exception
Finally
Grid.Dispose()
Grid = Nothing
End Try
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
i have windows server 2008 R2 webserver edition, SqlServer 2008 enterprise and PowerShell 2.0. But this is Sql C# code can't connect. But can connect offical components. Exam: SQLDataSource.
cs = "SERVER=.\\SQLEXPRESS;Initial Catalog=arch;Integrated Security=SSPI";
con = new SqlConnection(cs);
querystring = "SELECT user_name, password, user_type FROM [users]";
cmd = new SqlCommand(querystring, con);
con.Open();
I thing block code PowerShell. Help!
battulga
|
|
|
|
|
You say you have SQL Server 2008 enterprise, yet your connection string is for SQLEXPRESS. Is your SQL Server 2008 a named instance, named SQLEXPRESS ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
This is code can run before time on Windows Server 2008, SQLServer 2008.
battulga
|
|
|
|
|
I have 2 user controls:
-1 contains my collapsiblepanel control.
-My other contains a button I want to click to expand my collapsiblepanel
How can I pass the value of my button click in my 2nd user control over to my collapsiblepanel in my 1st user control?
Can this even be done?
Thanks.
|
|
|
|
|
In your designer.cs file (if it is a webapplication) you can change the protected global:: into public global:: for you button.
In that case the OnClick Event can be reached from your second control.
In your second control you add
Control1.fromOhterControl.OnClick += new EventHandler(fromOhterControl_OnClick);
and you create the method
protected void fromOhterControl_OnClick(object sender, EventArgs e)
{
}
That should work
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hello everyone! I have an asp:menu item in which the background color changes during a static and dynamic hover style. Everything looks great, however I have noticed that many of my users are mislead into thinking the whole area is clickable when in reality the anchor will only work if the mouse is over the text of the link. Is there a trick to changing the clickable area to take up the whole "background" that is changing rather than just the text? I've googled around but can't seem to find what I'm looking for.
Thanks in advance!
"You're damned if you do, and you're damned if you dont" - Bart Simpson
|
|
|
|
|
It sounds like you need a CSS fix for this. Here's some code I have for a CSS button. I'm not a css expert, but I believe it's the "display:block;" that does what you're looking for:
ASPX:
<asp:Hyperlink ID="lnkDefaultButton" runat="server" CssClass="defaultButton" Text="Button" Width="200" Height="20"/>
CSS:
a.defaultButton { background-color:white; width:200px; height:20px; display: block;outline: none;}
a.defaultButton:hover { background-color:black; width:200px; height:20px; display: block;outline: none;}
Does this work?
-Goalie35
|
|
|
|
|
Hi Goalie35,
no, that didn't seem to do the trick. I'm wonder if there's something within the asp:menu item that's overriding the css class?
<pre> <asp:Menu ID="Menu1" runat="server" DataSourceID="siteMapDataSource"
DynamicHorizontalOffset="2" Font-Names="Tahoma" Font-Size="11px"
StaticSubMenuIndent="10px" style="background-color: transparent;
font-weight: bold; vertical-align: top; margin-bottom:30px;
background-image: url(/designElements/interfaceImages/menubkg_new.jpg);"
Width="152px" ForeColor="#666666" DynamicEnableDefaultPopOutImage="False"
DynamicPopOutImageUrl="~/designElements/interfaceImages/menuarrow.gif"
StaticPopOutImageUrl="~/designElements/interfaceImages/menuarrow.gif" Height="275px"
CssClass="pointer" EnableTheming="False">
<DynamicHoverStyle BackColor="#8E8E8E" ForeColor="White" />
<DynamicMenuStyle CssClass="adjustedZIndex" BackColor="#D1D1D1" />
<DynamicSelectedStyle BackColor="#D1D1D1" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="5px" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="3px" ItemSpacing="1px" />
<StaticMenuStyle BackColor="#D1D1D1" />
<StaticHoverStyle BackColor="#8E8E8E" ForeColor="White" CssClass="pointer" />
</asp:Menu>
the pointer cssclass just has cursor: default; in it, but that's where I was adding the display:block and then creating a.pointer{ display:block;} but still not doing the trick.
"You're damned if you do, and you're damned if you dont" - Bart Simpson
|
|
|
|