|
can you please provide the code (specially when you are making the connection using ODBC)
|
|
|
|
|
Note: This works fine when i run the applicaiton from vs 2005. But only getting problem while i am running the application by hosting it on same machine.
if (_fileexten == ".csv")
{
string str = Path.GetFileName(_filename);
OdbcConnection conn = new OdbcConnection("Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + _fpath + "\\;Extensions=asc,csv,tab,txt;Extended Properties=\"HDR=YES;IMEX=1;\";Persist Security Info=False");
conn.Open();
string sql_select = "select FirstName, LastName, MiddleName, Zip from [" + str + "]";
OdbcDataAdapter myCommand = new OdbcDataAdapter(sql_select, conn);
myCommand.Fill(myDataSet, "csv");
dt = myDataSet.Tables[0];
conn.Close();
myCommand.Dispose();
}
G. Satish
|
|
|
|
|
It seems a bit weired problem. Check the ODBC configuration for all the available drivers, and check whether the Microsoft Text Driver is installed on the machine or not. You will find the ODBC Datasource ADministrator from Administrative Tools.
|
|
|
|
|
hi all,
i have search on net but not satisfied with ans...can anyone tell me that property or data of 1 page's viewstate can be used in another page?
Thanx
|
|
|
|
|
ViewState cannot be shared between pages. It is specific to a page. Use Session object to share data between pages.
|
|
|
|
|
thanx
but some people telling by server.transfer we can share data....i got that kind of ans from many forums....
some are saying no and some are saying yes..........so i m bit confuse on that..........
|
|
|
|
|
Using Server.Transfer you can not redirect to a different from the server itself.
Example if your server is www.yahoo.com you can use server.transfer to move
to www.microsoft.com but yes you can move to www.yahoo.com/travels, i.e.
within websites. This cross server redirect is possible only using
Response.redirect.
|
|
|
|
|
Have you checked this article[^]?
Let me know if this helps you or not.
|
|
|
|
|
i have checked but i cant understand that article....
i m so confused....my que is can we transfer the data from one page to another using view state...
that que asked in my interview but i not getting satisfaction yet bcoz some people saying that it can be possible....
|
|
|
|
|
|
What the State Management Types?
Client-side state management stores information on the client’s computer by embedding the information into a web page (Hiddenfields), URL (Query strings) or a cookie.
1. View state.
2. Control state: If you create a custom control that requires view state to work, you should use control state to ensure (يضمن) other developers don’t break your control by disabling view state.
3. Hiddenfields: hidden fields store in HTML form without displaying it in the user’s browser.
4. Cookies: cookies store a value in the user’s browser.
5. Query strings: query string stores values in URL.
Server-side state management stores information on server’s memory.
1. Application state.
2. Session state.
3. Profile Properties.
4. Cache state.
What the disadvantages are of ViewState?
- Disadvantages of ViewState:
1. The more controls you have on the form the larger the size of ViewState and the larger the size of the HTML you send back and forth to the server.
2. Only works when pages postback to themselves.
3. You can't persist (تحفظ) data to other pages.
|
|
|
|
|
thanx.........have u seen that link of asp.net forums which i have posted here,in that with examples they have explaine it can be possible so confused n asking.......
whats your opinion on that discussion........all that ans were wrong on that?
|
|
|
|
|
actually i am too preparing for interview... in my preparing and experience i have never heard that the viewstate can be transfered from one page to another......
|
|
|
|
|
vid nandha wrote: whats your opinion on that discussion
The opinion is very simple - viewstate is page specific. This should be enough to remove your confusion.
Now you mentioned that Server.Transfer with respect to this topic.
1. Server.Trasfer allows you access the instance of the source page. Using that you can access any property defined in that. It's not about accessing the ViewState, it's about accessing the reference of the source page.
2. In practice, a class hides the members which other class can not access. There should be some interfaces (methods) which would allow other classes to interact with the members. Now suppose you have all public properties then what's use of wrapping them. The same thing is applicable here.If you can access the source page's instance in the target page (while Server.Transfer),you can access everything of that page (if you wish) not only the ViewState.
As a practice, you can not access ViewState of any page from other page.
|
|
|
|
|
no. thats specific answer. as per your question specification, answer is no.
u can not use viewstate data in other page. so don't go for any forum or other.
hope thats fine.
Regards
Keyur Satyadev
|
|
|
|
|
Hi There I have menu tree.I had given path of my web forms in menu tree using naviage url propery.My web forms are present in admin folder. My problem is that when I run the project using following code then my page doesn't get open.
Menu Tree Code
<asp:menu id="Menu1" runat="server" skinid="Menu">
<items>
<asp:menuitem text="Admin" value="Admin">
<asp:menuitem navigateurl="~/Admin/Company.aspx" text="Company Master"
="" value="Company Master">
<asp:menuitem navigateurl="~/Admin/BranchMaster.aspx" text="Branch Master"
="" value="Branch Master">
<asp:menuitem navigateurl="~/Admin/CreateUser.aspx" text="Create User"
="" value="Create User">
<asp:menuitem navigateurl="~/Admin/RoleMaster.aspx" text="Role Master"
="" value="Role Master">
But when I keep my web forms in root directory and Change the path to
NavigateUrl="~//Company.aspx" then it works.Why this is happening
Even I tried ~//Admin/CreateUser.aspx but it is also not working.
Can anybody tell me what is the reason.
(I am running my project web server on net)
Life Is Beautiful
modified on Tuesday, August 11, 2009 2:51 AM
|
|
|
|
|
try navigateurl like this
Replace (~) with (..)
asp:Menu id="Menu1" runat="server" SkinID="Menu">
<asp:MenuItem Text="Admin" Value="Admin">
<asp:MenuItem NavigateUrl="../Admin/Company.aspx" Text="Company Master"
Value="Company Master">
<asp:MenuItem NavigateUrl="../Admin/BranchMaster.aspx" Text="Branch Master"
Value="Branch Master">
<asp:MenuItem NavigateUrl="../Admin/CreateUser.aspx" Text="Create User"
Value="Create User">
<asp:MenuItem NavigateUrl="../Admin/RoleMaster.aspx" Text="Role Master"
Value="Role Master">
|
|
|
|
|
Thanks for reply Zafar,
I will try your code. But when googled on this problem every body suggested not use ../ Instead of they suggested to use ~/
Life Is Beautiful
|
|
|
|
|
I tried that code but it is not working.
Life Is Beautiful
|
|
|
|
|
~//Admin/CreateUser.aspx
"/" is considered as a escape sequence...
so use ~//Admin//CreateUser.aspx ... hope this will work
|
|
|
|
|
Of course it won't. Since when is "/" the escape sequence of anything?
In C# the escape sequence is "\".
The problem lies with the layout though. You have to embed menuitems in an Items tag, like this:
<asp:Menu runat="server">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="New Item" Value="New Item">
</asp:MenuItem>
<asp:MenuItem NavigateUrl="~/Default2.aspx" Text="New Item"
Value="New Item"></asp:MenuItem>
</Items>
</asp:Menu>
Also, would really be advisable if you actually CLOSED your menuitem tags. The path is correct as it is.
var question = (_2b || !(_2b));
|
|
|
|
|
ais07 says:
But when I keep my web forms in root directory and Change the path to
NavigateUrl="~//Company.aspx" then it works.Why this is happening
Even I tried ~//Admin/CreateUser.aspx but it is also not working.
there is no error message metioned....
|
|
|
|
|
i have three textboxs,that contains
1) number of female students (txtfemale)
2) number of male students (txtmale)
3) total number of students (txttotal)
now i want that when i enter records in the first two textboxs it show total number of students in txttotal automatically.
what should be my code??
|
|
|
|
|
please read basic book of programing. how to add two numbers
|
|
|
|
|
haleemasher wrote: now i want that when i enter records in the first two textboxs it show total number of students in txttotal automatically.
what should be my code??
You can easily do it using javaScript. Use onblur event of txtmale textbox, call a javascript function, where get the value of txtfemale and txtmale and calculate the sum and put it on txttotal using javasctipt itself.
Hope, It will help you
|
|
|
|