|
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
|
|
|
|
|
Sessions will not be shared. So each customer will have their own session. Having said that, keeping shopping cart information in session is not a neat idea. Better way would be to create a table in your database and keep it there. Once the order is placed, remove the data from this table. Keep the shopping cart identifier in session, so you can access the shopping cart data from table using this identifier.
|
|
|
|
|
hello,
asp.net, regular form authentication.
I want to make sure that IE / firefox suggest my password by auto filling the user and password text boxes, so I don't have to fill those in all the time.
what do I have to do?
I guess the buttons need some sort of clientID so that the browser recognize them as username/password fields?
note:
- it's not about making the form authentication cookie persistent (aka remember me)
- I don't want to store the credentials in a separate cookie, I just want to use the browser functionality.
thanks,
Niko
<< Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>
|
|
|
|
|
AFAIK, that is completely controlled by browsers and you have no access on it.
|
|
|
|
|
but how does the browser knows this?
somehow a browser can recognize a login form.
<< Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>
|
|
|
|
|
NikoTanghe wrote: asp.net, regular form authentication.
I want to make sure that IE / firefox suggest my password by auto filling the user and password text boxes, so I don't have to fill those in all the time.
You want Browser user id and password would fill automatically or what ? we don't have any control on them. You can stop them to prompt and user should logged with the credentials that they provide in your application.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
I don't completely understand your answer.
Yes, I want my browser to auto-complete the username and password boxes.
chrome can do this. when logging in to a site, protected with form authentication.
chrome will suggest you to save the credentials that you have used to authenticate.
The next time when you visit the site, both fields are filled in automatically by the browser.
<< Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>
|
|
|
|