|
Ravenet wrote: i told page refresh and data show time
No, you said
Ravenet wrote: if you put in the updatepanel, doesn't take much more time for this operation.
With only 2.5 years you obviously don't have "excellent experience in programming" or "excellent knowledge...with all other MS related languages and databases"
only two letters away from being an asset
|
|
|
|
|
Hi Man
i said about loading time . not data transfer time
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
Hello Mr. Rave
I am not a very good programmer, just tryied following code but its not working.
when ever I am pressing delete button after selecting a value in dropdownlist, it just deleting the top most value.
--------------------------------------------------------------------------
C# CODE:
--------------------------------------------------------------------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class newDeleteValueDDList : System.Web.UI.Page
{
OleDbConnection cn;
OleDbCommand cmd;
DataSet ds;
OleDbDataAdapter da;
protected void Page_Load(object sender, EventArgs e)
{
getData();
}
protected void Button1_Click(object sender, EventArgs e)
{
connectDatabase();
string str = DropDownList1.SelectedValue;
string strDelete = "delete state from tblState where state='" + str + "'";
cmd = new OleDbCommand(strDelete, cn);
cmd.ExecuteNonQuery();
cn.Close();
getData();
}
private void connectDatabase()
{
string strConnectionString = Server.MapPath("~/App_Data/dummyDb.mdb");
cn = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" + strConnectionString);
cn.Open();
}
private void getData()
{
connectDatabase();
string strSelectState = "select state from tblState order by state";
da = new OleDbDataAdapter(strSelectState, cn);
ds = new DataSet();
da.Fill(ds);
DropDownList1.DataSource = ds.Tables[0];
DropDownList1.DataTextField = "state";
DropDownList1.DataValueField = "state";
DropDownList1.DataBind();
cn.Close();
}
}
-------------------------------------------------------------------------
DESIGN SOURCE:
-------------------------------------------------------------------------
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Delete" /></div>
</form>
</body>
--------------------------------------------------------------------------
ACCESS DATABASE:
--------------------------------------------------------------------------
ID STATE
-- -----
10 AAA
20 BBB
30 CCC
40 DDD
--------------------------------------------------------------------------
I am sending the relevent db and code which has been used in my code
If anybody can help I will be grateful to him.
Thanks
wajid
|
|
|
|
|
Are you certain that DropDownList1.SelectedValue is correct?
Since ID appears to be a unique key in the table structure use that for the value. This eliminates the need to pass strings around and do string comparisons. It also guards against deleting multiple rows with duplicate state values.
DropDownList1.DataValueField = "ID";
int id = Convert.ToInt32(DropDownList1.SelectedValue);
string strDelete = "delete state from tblState where ID=" + id + ";
only two letters away from being an asset
|
|
|
|
|
Hi Mark
Thanks for your help.
But still its giving same problem.
Thanks Again
Wajid
|
|
|
|
|
string strDelete = "delete state from tblState where ID=" + id + ";
only two letters away from being an asset
|
|
|
|
|
Hi Mark
Same old problem, Its not working.
But thanks for your suggestion.
Thanks
Wajid
|
|
|
|
|
i want to execute the text written in text box
e.g
i have a function
public void func(string s)
{
}
what i want to achieve is if i write
func("waheed")
in the textbox this function should be called on clicking a button
i cant use if/case etc
my requirement is this the textbox text will be passed to another function where this text will execute as code
Thanks
|
|
|
|
|
waheed awan wrote: i want to execute the text written in text box
e.g
i have a function
public void func(string s)
{
}
what i want to achieve is if i write
func("waheed")
in the textbox this function should be called on clicking a button
If you want this on javascript try the below on the onclick event of the button, (OnClientClick, if it is a Server Side button)
func(document.getElementById('MY_TEXTBOX').value)
If you want the above in ASP.NET, double click button, it will take you to the code behind, where you can try the below code in the Button Click event,
func(MY_TEXTBOX.Text);
Here MY_TEXTBOX is the ID of the textbox you mentioned
modified on Tuesday, February 12, 2008 9:52 PM
|
|
|
|
|
document.getElementById returns an object. How will this work in your example?
only two letters away from being an asset
|
|
|
|
|
It should be
func(document.getElementById('MY_TEXTBOX').value);
Thanks Marks for pointing out.
|
|
|
|
|
|
THANKS
the arical you gave me reference is very helpful and it solved another problem that i was facing
but here my problem is
as i write
func("vaue"); in the cs file the function is called
what i want to achieve is when i write
func("vaue"); in the textbox then on clicking the button the textbox should be executed
|
|
|
|
|
waheed awan wrote: then on clicking the button the textbox should be executed
I don't understand what you are asking for here.
Do you want something like; func("Console.WriteLine("Hello, World");" ) which causes "Hello, World" to be written to a console window?
only two letters away from being an asset
|
|
|
|
|
i want to say
the textbox will be used to write code statements and clicking the button will execute the statement written in the textbox
Example;
if in the textbox i write
MessageBox.Show("Hello");
then clicking the button executes the statement in the textbox in this case display a messagebox
|
|
|
|
|
Then read my previous response about CodeDOM, and the warning that this is VERY dangerous thing, don't do it, think of another way.
only two letters away from being an asset
|
|
|
|
|
THANKS
the arical you gave me reference is very helpful and it solved another problem of adding a class that i was facing
but here my problem is
as i write
func("vaue"); in the cs file the function is called
what i want to achieve is when i write
func("vaue"); in the textbox then on clicking the button the textbox text should be executed
|
|
|
|
|
Im my online photo album i have three tables categories, pictures, and comments
only logged in people can post or edit or leave comments. I also have a chat room that only logged on users can chat on. When you sign up for an account you add name ..password,ect,ect, and an Email address. Now here is my question, I want to have a link or button click that would say leave message..to the person that posted the pic.
What table would the Email go in the pictures or the comments,or would I need a fourth
table?
Any help on this would be greatly appreciated. I seen a working example of this at
Plenty of fish .com you click on a pic after you create an account and you will see the send message button. But you never see the persons email. I would like this but am sure i am not smart enough yet on this matter
Sincerly
Paul quinn
|
|
|
|
|
I'd imagine that the logical thing would be that a users email address is part of the table that stores login information, and the id of the user who sent the photo would be stored in the table with the photos. So, you'd use the Id to look up the email address in the other table.
This is really a SQL question.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I have a development and testing environment. I have set the the following on my web.config file:
authentication mode="Windows"
identity impersonate="true"
And I'm trying to list directories and its subfolders and files from a different file_server/shared on my page.
In my development environment, it is working fine. I was able to see the folders and files, but in the testing it is giving me:
System.UnauthorizedAccessException: Access to the path "file_server/shared" is denied.
On both development and testing IIS, I have the "Integrated Windows authentication" checked only. I granted "Everyone" and "Authenticated Users" read only to the file_server/shared. My codes are exactly the same on both environments. I'm also able to get the "WindowsIdentity.GetCurrent.Name" on both environments.
I'm totally puzzled. Can anyone help me on how to troubleshoot this?
Thank you very much
May
|
|
|
|
|
mayl wrote: I have a development and testing environment.
What is the development environment you meant to say? Is it your machine which you used for development?? Whats is the OS or IIS version used in it?
Whats is the OS or IIS version used in your testing environment?
|
|
|
|
|
Hi,
We have 2 separate servers, one for development and one for testing. The OS is Windows 2000 and IIS version 5.
thank you
|
|
|
|
|
Hi Guy
can i know about your OS and development envoriment?
becuase of if u Vista,little triky...
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
It's not Vista. Both environment are using Windows
thank you
|
|
|
|
|
OK
so can u give a full rights to parent folder. or use ACL in .net
Cheers
RRave
MCTS,MCPD
|
|
|
|