|
Can you tell me how you can export?
Regards,
John.L.Ponratnam
|
|
|
|
|
Hi All,
Glance this code..
" Public Sub CreateNewRow()
Dim index As Integer
index = StatusGrid.Items.Count
Dim da As New SqlDataAdapter
conn.Open()
da = New SqlDataAdapter("select * from Status", conn)
'New Row Creation
da.Fill(dt)
dt.Rows.Add(dt.NewRow)
'dt.Rows.InsertAt(dt.NewRow(), index)
StatusGrid.EditItemIndex = index
dt.AcceptChanges()
StatusGrid.DataSource = dt
StatusGrid.DataBind()
conn.Close()
End Sub"
With this code, I got new row in the datagrid.
But the problem Occurs, When the pagesize exceeds.
Here I have given pagesize as 10.
Assume there is 10 rows.Now When AddNewRow button is clicked, I should get new row in next page.(Total 11 rows).10 in first page and the new row in next page.
How can I get this?
Thanks in Advance...
modified on Wednesday, November 5, 2008 4:02 AM
|
|
|
|
|
Hai All,
I needs help in a login page that if a user entered into a page by username and password,if he will reopen the same login page in a new tab or in a new browser. He will automatically redirected to the logged in home page
How it can be done?
I tried with session, it will work nicely in new tab option but for new browser means the session automatically recreated with different id and not allowing me to logging In without the verification.
Can any one give an concept/technology to solve this problem.
Thanks in Advance
with regards,
Senthil.S
A Software Engineer
|
|
|
|
|
Have you tried cookies yet?
|
|
|
|
|
No. Actually i used the same sessions on most of the pages and i don't not to change sessions to cookies.
Senthil.S
A Software Engineer
|
|
|
|
|
Hi,
Does your requirement allow you to use Windows Authentication? If it is yes, then just use that.
Either you love IT or leave IT...
|
|
|
|
|
or the simple way is just keep a flag in database means when the user logs in set the flag to true and check this flag's value on Page Load event of the login page i.e if the flag is true the it will automatically redirect the page to another page else will not do any thing means will simply load the login page. and set flag to false when logged out
this will serve your purpose.
In this case you can open no of windows dont worry it will definately open as logged in.
Darshana Pathak
|
|
|
|
|
Good Afternoon Guys
i have a Web Application that, it has a login Screen. I tried to make sure that a User does not bypass the login Screen on the Page load event i used the following line of code
if (Session.IsNewSession)
{
Response.Redirect("login.aspx");
}
.
to Prevent the user going straight to other pages ,i have successfully used this code
Response.Write("<script> window.history.forward(1);</script>;"); .
to make sure that they dont use back to bypass the Pages. Now if a User can log in and Copy the URL to the Exact page they want it does directly ,
How can i prevent this
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
can you elaborate more the line you written given below
"Now if a User can log in and Copy the URL to the Exact page they want it does directly"
Cheers!!
Brij
|
|
|
|
|
Thanks for your reply.
What i mean is that a User can login with the Correct Credentials. While busy navigating the Site , while login. He might relize that he want to access a Certain page Directly without going through a Login page. while logged in he might copy the URL ,
e.g
http:
So now he will logout and paste this address in the address bar and this will take him to the page without loggin in.
So i want to prevent this
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
did u use session.abandon() at the time of logging out.
Cheers!!
Brij
|
|
|
|
|
Yes i did use Session.abandon(). Let me elaborate more clearer about my Situation.
i have created my Login Page and it was two Buttons and we will look into the button that does login in my login Button i have the Following
protected void btlogin_Click(object sender, EventArgs e)
{
String strusername = txtUsername.Text;
String strPassword = txtPassword.Text;
BLL.BLL obj = new BLL.BLL();
int bl = 0;
try
{
bl = obj.Check_Login(strusername, strPassword);
if (bl == 1)
{
Session["USERNAME"] = strusername;
Response.Redirect("Welcome.aspx", false);
}
else
{
Response.Write("<script language='javascript'>alert('Invalid Login');</script>");
}
}
catch (Exception)
{
Response.Write("<script> alert('ex.Message');</script>");
}
}
Now i have my Business logic that Calls the Function that Calls the function in a Data Access Layer that will call the StoreProcedure.
like this
public int Check_Login(String username, String password)
{
int ans = 0;
DAL.DAL obj = new DAL.DAL();
try
{
ans = obj.Check_Login(username, password);
}
catch (Exception)
{
throw;
}
return ans;
}
and from the DAL i execute my SP like this
public int Check_Login(String Username, String Password)
{
con = new SqlConnection(strconlogin);
cmdselect = new SqlCommand();
cmdselect.CommandTimeout = 0;
cmdselect.CommandType = CommandType.StoredProcedure;
cmdselect.CommandText = "dbo.prcLoginv";
cmdselect.Parameters.Add("@User_name", SqlDbType.VarChar, 50, "UserName").Value = Username;
cmdselect.Parameters.Add("@U_Password", SqlDbType.VarChar, 50, "UPassword").Value = Password;
cmdselect.Parameters.Add("@Results", SqlDbType.Int);
cmdselect.Parameters["@Results"].Direction = ParameterDirection.Output;
cmdselect.Connection = con;
int res = 0;
try
{
con.Open();
cmdselect.ExecuteNonQuery();
res = Convert.ToInt32(cmdselect.Parameters["@Results"].Value);
con.Close();
}
catch (SqlException)
{
throw;
}
return res;
}
Now all my Pages Contains this Code , excluding the login page
Response.Write("<script> window.history.forward(1);</script>");
if (Session["USERNAME"] == "")
{
Response.Redirect("login.aspx");
}
Well here i was to redirect the Users to the login page if the Session Variable is Empty. Well from the Developement site it works but as i said the User can use a full URL to go to a Certain page.
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi,
how many data store in one Sql database?
|
|
|
|
|
What you are Saying does not make sense.
Try to refrase your question.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Are you asking about the maximum size of database?
Sql server Express edition: 4 GB
Sql Server 2008: 524,272 TB
*jaans
|
|
|
|
|
|
shanthi jothi wrote: how many data store in one Sql database
Lots.
Please ask your question in a way that people can understand, that way you will get a proper answer.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
int day = firstDay.Day + 1;
for (int j = i; j <= i + DaysinMonth; j++, k =(k + 2))
{
1. string a = k.ToString();
2. string s2 = string.Concat("TextBox", a);
3. TextBox myTextBox = (TextBox)FindControl(s2);
4. myTextBox.Text = Convert.ToString(day);
5. day = day + 1;
6. if (day == (int)lastDay.Day + 1)
7. break;
}
On Line No 4 error is "Object Reference is not set to an instence of an object."
|
|
|
|
|
I guess the FindControl in step 3 didn't find the control, hence myTextBox is null. Try debugging and check if the control exists.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
s2 in stop 2 and 3 contains the TextBox id .
I cannot understand whats the problem.
Is the problem can be due to Masterpage.But my all textbox control are in content place holder and i am not using any control from master page.
|
|
|
|
|
Have a look in view source and see what the textbox id really is, then adjust your code accordingly.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I have a small doubt that, i want to create 3 seperate projects for 3 layers for my small web application. In that i dont want to place my BAL and DAL in the App_Code folder but i want to manage 3 seperate layers. So how to do that? Can anyone explain about it.
Its urgent please let me know.
|
|
|
|
|
Samiullah wrote: i dont want to place my BAL and DAL in the App_Code folder
Why not? Its the correct place for them.
Samiullah wrote: Its urgent please let me know.
Only for you, nobody else cares.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
It should be Simple , First Create a Website and add a new Project "Class" DAL and another "Class" BLL and you havea Separate Layers , see how i do it
http://www.codeproject.com/KB/vb/N-Tier_Application_VB.aspx[^]
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Just make a Class Library type project for a layer (define class and function inside it) except UI layer.Add there's dll in the UI layer and use them.
Cheers!!
Brij
|
|
|
|