|
merahul wrote: hello..
i am trying to make a logout function.....
can anyone give me some idea about it.......
Ok. I believe you are storing the user information in session variable. So, use Session.Abondan() while log off. and while checking the Session in Home Page, check first session is null or not before doing in steps, if its null redirect to login page.
|
|
|
|
|
|
What actually you want to do,you want to redirect to another page or anything else.
|
|
|
|
|
Hi all
i am doing export to excel operation using below code.
public void ExcelExport(System.Data.DataTable tblExportData, string TempFilePath,string userInfo,bool headerStatus)
{
try
{
Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
excelApp.Workbooks.Open(TempFilePath, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
//Writing Header in Excel
if (headerStatus == true)
{
for (int i = 0; i < tblExportData.Columns.Count; i++)
{
excelApp.Cells[7, i + 1] = tblExportData.Columns[i].ColumnName;
}
}
//Writing Data in Excel
for (int i = 1; i <= tblExportData.Rows.Count; i++)
{
for (int j = 0; j < tblExportData.Columns.Count; j++)
{
string colName = tblExportData.Columns[j].ColumnName;
excelApp.Cells[i + 7, j+1] = tblExportData.Rows[i-1][colName];
}
}
//Create a worksheet object
Microsoft.Office.Interop.Excel.Sheets sheets = excelApp.Worksheets;
//from the collection of worksheet select one worksheet
Microsoft.Office.Interop.Excel.Worksheet mySheet = (Microsoft.Office.Interop.Excel.Worksheet)sheets.get_Item(1);
//select the cell in the worksheet
Microsoft.Office.Interop.Excel.Range myCell1 = (Microsoft.Office.Interop.Excel.Range)mySheet.get_Range("A6", "A6");
myCell1.Value2 = userInfo;
myCell1.Font.Color = System.Drawing.Color.Black.ToArgb();
excelApp.Visible = true;
}
catch (Exception ex)
{
}
}
it's working fine in local. but when i deployed this on server(e.g.relience server) then it stops to work. i mean exporting to excel not working. Even it's not generating any error and page is redirecting also. can any one help me please.
thanks to you all in advance.
|
|
|
|
|
Please do NOT cross post, its rude
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
not getting the cookie value in next page
in my first page i am assigning a cookie a value
Protected Sub LnkEng1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LnkEng1.Click
Dim appCookie As New HttpCookie("lang")
Thread.CurrentThread.CurrentCulture = New CultureInfo("es-ES")
LoadStrings(Thread.CurrentThread.CurrentCulture)
Response.Cookies("lang").Value = Thread.CurrentThread.CurrentCulture.ToString
Response.Cookies.Add(appCookie)
End Sub
------------------------------------------------------
but in next pg i am not getting the value of the cookie
If Request.Cookies("lang").Value Is Nothing Then
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
'get the culture info to set the language
rm = New ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"))
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
ElseIf Request.Cookies("lang").Value = "es-ES" Then
Thread.CurrentThread.CurrentCulture = New CultureInfo("es-ES")
'Request.Cookies("lang").Value = ci.ToString
'Thread.CurrentThread.CurrentCulture = Session("lang")
rm = New ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"))
ci = Thread.CurrentThread.CurrentCulture
'ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
tanx
-------------
|
|
|
|
|
Good Morning anbusenthil
Why dont you use a Session ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi I am using Treeview control.It has one parent node and several leaf nodes.In SelectedNodeChanged event whenever I am selecting any leaf node, it's taking only the first leaf node.
How to solve this problem?
ARINDAM
|
|
|
|
|
ARINDAM1981 wrote: In SelectedNodeChanged event whenever I am selecting any leaf node, it's taking only the first leaf node
I think, this issue is related with Postback. Can you please post your code ?
|
|
|
|
|
Protected void Page_Load(object sender,EventArgs e)
{
if (!IsPostBack)
{
PopTree();
}
}
public void PopTree()
{
TreeView1.Nodes.Clear();
com = new OracleCommand();
con = new OracleConnection(ConfigurationManager.ConnectionStrings["constr"].ConnectionString);
com.Connection = con;
com.CommandText = "select a.meeting_no,a.meeting_no ||'-->' || a.meeting_desc comb,b.meet_no from tpc_meetings a,tpc_meets b where a.meeting_no=b.meeting_no and a.status='LIV' and b.status='LIV' order by a.meeting_no,b.meet_no";
da = new OracleDataAdapter();
ds = new DataSet();
da.SelectCommand = com;
da.Fill(ds, "Meets");
object[] marr = GetDistinct(ds.Tables["Meets"], "meeting_no");
foreach (object mval in marr)
{
string mcomb = ds.Tables["Meets"].Select("meeting_no='" + mval.ToString() + "'")[0]["comb"].ToString();
TreeNode meetingnode = new TreeNode(mcomb);
meetingnode.SelectAction = TreeNodeSelectAction.None;
TreeView1.Nodes.Add(meetingnode);
string matchval = dal.ModifyStringDotNet(meetingnode.Text.Trim());
DataRow[] children = ds.Tables["Meets"].Select("comb='" + matchval + "'");
foreach (DataRow drow in children)
{
TreeNode meetnode = new TreeNode(drow["meet_no"].ToString(),drow["meeting_no"].ToString());
meetnode.SelectAction = TreeNodeSelectAction.Select;
meetingnode.ChildNodes.Add(meetnode);
}
}
}
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
com = new OracleCommand();
con = new OracleConnection(ConfigurationManager.ConnectionStrings["constr"].ConnectionString);
com.Connection = con;
try
{
com.CommandText = "select meeting_no,meet_no,to_char(to_date(meet_date,'yyyymmdd'),'dd-mm-yyyy') meet_date," +
"to_char(to_date(meet_date||' ' || meet_time,'yyyymmdd hh24mi'),'hh:mi PM') meet_time," +
"chair_pno from tpc_meets where meeting_no=" + TreeView1.SelectedNode.Value + " and meet_no=" + TreeView1.SelectedNode.Text + "";
OracleDataReader dr;
con.Open();
dr = com.ExecuteReader();
if (dr.Read())
{
txtMeetingNo.Text = dr[0].ToString();
txtMeetNo.Text = dr[1].ToString();
txtMeetDate.Text = dr[2].ToString();
txtTime.Text = dr[3].ToString();
txtChairPno.Text = dr[4].ToString();
}
dr.Close();
btnSave.Text = "Update";
hPick.Visible = false;
txtMeetingNo.Enabled = false;
}
catch (Exception ex)
{
string ermsg = "window.alert('" + ex.Message + "');";
ClientScript.RegisterClientScriptBlock(this.GetType(), "erkey1", ermsg, true);
}
finally
{
if (con.State == ConnectionState.Open)
con.Close();
}
}
ARINDAM
|
|
|
|
|
Hi all
i need to know exactly the size of sql parameters when definning them. Ex:
SqlParameter foo = new SqlParameter(parameterName, dbType, size);
this.Add(foo);
I need to know size that should be send for each datatype, Ex: Bigint, float, varchar(max)...
Thanks
|
|
|
|
|
Hi
you can give the max size as per ur requirement.
But you have to follow while declaring the size of the parameter is not less than than the size of the parameter that u have declared in your stored proc's
|
|
|
|
|
Thanks for ur reply
This is what iam doing right now decaring the size the same as i declare them in stored procedures. But for some types there is a default or max size we should commit to. Is there a list where i can get these defaults?
Thanks
|
|
|
|
|
Can any one help me in providing a as-you-type spell check feature to an email application.
Thanks & Regards
Raveendar Reddy Kolan
|
|
|
|
|
Raveendar Reddy wrote: Can any one help me in providing a as-you-type spell check feature to an email application
It should be the features of the Editor that you are using for Mail Composing.
|
|
|
|
|
Hi,
How can i display data vertically in table format
eg:
Name Name Name Name
N1...N2....N3....N4
1....2 .... 4 ....7
3....1 .... 8 ....7
4....8.... 5.... 7
7 ....5 ....3 .... 8
Thankyou
YPKI
|
|
|
|
|
yes, you can do using DataList Control.
what you have to do is just get the required data into a dataset and bind the dataset to the DataList.
|
|
|
|
|
|
hello
can we use vs flex grid such type control into asp.net .
Because there are more limitation working with grid view control and its events .
so can we use any third party control with asp.net
|
|
|
|
|
Bandanenilima wrote: can we use vs flex grid such type control into asp.net
No
Bandanenilima wrote: so can we use any third party control with asp.net
Yes, there are loads available.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
which third party control we can use in sap .net.
Can this works like any grid or flexgrid control
|
|
|
|
|
Bandanenilima wrote: sap .net
As far as I know there is no such thing.
Bandanenilima wrote: which third party control
Try using google and choose one for yourself, some are free and some cost money. Its up to you.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
yes we can use..
http://forums.devarticles.com/net-development-43/msflexgrid-in-asp-net-6583.html
|
|
|
|
|
Hi,
I can able to Open Child Window in PopUpextender in button Click Event by(Modalpopupextender.show() syntax), but i am not able to open when we click GridView Row in FireFox. Its working fine in IE.
I am not able to close the Child window in all the cases.
|
|
|
|
|
Hi,
I am new to asp.net3.5,i am using asp:calender , but why the title font of calender(month year,<,>) coming outside of calender and also out side the asp:form .i am using it inside update panel
<asp:calendar id="Calendar1" runat="server" backcolor="White"
="" bordercolor="#3366CC" borderwidth="1px" cellpadding="1" cssclass="style45" daynameformat="Shortest" font-names="Verdana" font-size="8pt" forecolor="#003399">
<selecteddaystyle backcolor="#009999" font-bold="True" forecolor="#CCFF99">
<selectorstyle backcolor="#99CCCC" forecolor="#336666">
<weekenddaystyle backcolor="#CCCCFF">
<todaydaystyle backcolor="#99CCCC" forecolor="White">
<othermonthdaystyle forecolor="#999999">
<nextprevstyle font-size="8pt" forecolor="#CCCCFF">
<dayheaderstyle backcolor="#99CCCC" forecolor="#336666" height="1px">
<titlestyle backcolor="#003399" bordercolor="#3366CC" borderwidth="1px"
="" font-bold="True" font-size="10pt" forecolor="#CCCCFF" height="25px" horizontalalign="Center" borderstyle="Dotted" wrap="True">
modified on Wednesday, June 17, 2009 3:11 AM
|
|
|
|