|
Use
Page.Theme = themename;
on page pre init event.
for details check this...
http://www.codeproject.com/KB/HTML/ThemeChanging.aspx
The miracle is this--the more we share, the more we have.
|
|
|
|
|
I will suggest you to write a HTTPHanlder for that.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hi all...
In my asp.net page i have used one tabcontainer with 3 tabs....all controls r inside this....i have used upadatepanel also..now i have placed a hiddenfield which is totally outside of tabcontainer,to fetch a value from the textbox on a button click....value is getting to hiddenfield but when am trying to take that value into javascript variable its giving nulll.(am passing that id from external jscript...)
function GetObj(id)
{
var val=this.document.getElementById(id).value;
return val;
}
can anubody tel me to get the value?....
|
|
|
|
|
I'm sure you realize, the tabcontainer adds stuff to the id of its child controls.
Like if you have a Panel1 inside a TabPanel2 in a TabContainer1 it's most likelly gonna be something like: TabContainer1_TabPanel2_Panel1. Debug it and see for yourself. Or look at the source in your browser.
Oh, and obviously, remember, if you're using masterpages, they do that too.
Disregard that, I misread your post.
var question = (_2b || !(_2b));
|
|
|
|
|
hi
I'm trying to execute a stored procedure which returns a datatable
my code is:
try
{
string conStr = WebConfigurationManager.ConnectionStrings[0].ConnectionString;
SqlDataAdapter adapter;
DataTable ans = new DataTable();
SqlConnection connection = new SqlConnection(conStr);
SqlCommand command = new SqlCommand();
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "usp_GetUserDetails";
command.Parameters.Add("@UserName", SqlDbType.VarChar);
command.Parameters.Add("@Password", SqlDbType.VarChar);
command.Parameters["@UserName"].Value = user;
command.Parameters["@UserName"].Direction = ParameterDirection.Input;
command.Parameters["@Password"].Value = pass;
command.Parameters["@Password"].Direction = ParameterDirection.Input;
adapter = new SqlDataAdapter(command.CommandText, connection);
adapter.Fill(ans);
return ans;
}
catch (Exception ex)
{
throw ex;
}
when i execute i get an exception:
An attempt to attach an auto-named database for file C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\WebSites\WebSite1\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be Opened, or it is located on UNC share.
i tried to look for a solution but didnt find something helpfull.
|
|
|
|
|
please change the name of your database and if you not get the
output put your proceduce here. so i will give you the code or reason
of your question? from your error its shows that name is already exist
or file should not opened.
Regards
Keyur Satyadev
|
|
|
|
|
i tried to change the database name, i even created a new empty database and tried only to open a connection, (without executing the procedure) i got the same exception.
the procedure code:
ALTER PROCEDURE [dbo].[usp_GetUserDetails]
-- Add the parameters for the stored procedure here
@UserName varchar(50),
@Password varchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
select
*
from
tbl_Users
where
UserName = @UserName and
Password = @Password
END
|
|
|
|
|
adapter = new SqlDataAdapter(command,connection);//change here
make change and try to run. this will get you the result.
if u not get the result plz debug your check and see from which
point the error should generate.
put that point and error. i am using dataset then their is
no error in my pc.
My Code Which Run Successfully is under this is only for your review.
(
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["empstring"].ConnectionString);
SqlCommand com=new SqlCommand();
SqlDataAdapter adp;
DataSet ds;
con.Open();
com = new SqlCommand();
com.CommandText = "selectrecordall";
com.CommandType = CommandType.StoredProcedure;
com.Connection = con;
ds = new DataSet();
adp = new SqlDataAdapter(com);
adp.Fill(ds);
)
Regards
Keyur Satyadev
|
|
|
|
|
my mistake, i used the wrong connection string.
thanks for the help
|
|
|
|
|
always welcome peopel who want to share proper knowledge
regards
keyur satyadev
|
|
|
|
|
i am working on mass upload of things from excel sheet to database.and i don't want to use file upload method and i have done mass upload of data from excel to gridview and i want to export this gridview data to database .... can any body post code for this ... i am using c#
|
|
|
|
|
NRHSR wrote: i want to export this gridview data to database
Loop through the records and insert each row to database. If there is going to be bulk records, you should send chunks of data to the procedure and avoid hitting DB each time in the loop.
|
|
|
|
|
how to send chunks of data can you give the code please .... i am new to asp.net
|
|
|
|
|
how to send bulk records plz..... help ...
|
|
|
|
|
|
|
Please - This forum is for ASP.NET discussions and your question has nothing to do with it. Please read the posting guidelines before you post the question.
|
|
|
|
|
Hi, i need to display the times on my webpage. They are start time, end time and the reultant time.
i wrote the following code.
TimeSpan _starttime = DateTime.Now.TimeOfDay;
TimeSpan _endtime = DateTime.Now.TimeOfDay;
TimeSpan _finaltime = _endtime.Subtract(_starttime);
Response.write("Start Time: " + _starttime + "-- End Time: " + _endtime + "-- Finaltime:" + _finaltime);
i am getting result as
02:45:27.9085452-- End Time: 02:52:59.2926579-- Finaltime:00:07:31.3841127
Here i am getting milliseconds...how to avoid this in displaying.
i want to display time as 02:45:27
G. Satish
|
|
|
|
|
Use ToString[^]. See the different pattern ToString takes.
Alternatively, you can use StopWatch[^] class.
|
|
|
|
|
use DateTime.Now.ToString("hh:mm:ss")
|
|
|
|
|
various way to achieve this but easiest way is as sachin describe
DateTime.now.ToString("hh:mm:ss")//suggested Or
altername when you bind the data its change the string format(for knowledge purpose)
Regards
Keyur Satyadev
|
|
|
|
|
Hi,
I want to display pager even if the no. of rows in my grid view is less than the page size.
It might be many times illogical to do so, but please tell me if there is any way to do it.
|
|
|
|
|
Here[^] you go.
Google is very helpful, always
|
|
|
|
|
|
Hello Everybody
i kept the following code into web.config
<authentication mode="Forms">
<forms loginurl="login.aspx" defaulturl="default.aspx" cookieless="UseUri" timeout="30" slidingexpiration="true" />
<authentication>></authentication>
and my login.vb as follows
FormsAuthentication.RedirectFromLoginPage(_loginCheck.memberID, False)
I am developing an online ordering system but Im a bit confused, why I am confused?
I am using a session table to keep order information. At the same time more customer logged in into system and adding product into shopping basket.
My question is..
Wheather customer will share the same session table or diffrent session table will be create for diffrent customer?
Thanks in Advance
Sarfarj Ahmed
|
|
|
|