|
You have to get the id using the same connection that you used to add the record.
---
b { font-weight: normal; }
|
|
|
|
|
If you want retrieve @@IDENTITY in MS Access you can use this function after inserting record in database : "Select Max(FieldName) From tableName"
|
|
|
|
|
Hello All,
I am working on ASP.NET 1.1. I am using a Panel control to add some controls at the runtime. Now the problem is that when the page displays, the panel moves to the bottom of the page. I have the panel in a table, but it moves out of that table and goes to the bottom. I am screwed up by this issue. Any help is very much appreciated.
thanks,
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Hi Mubashir.
It's an HTML issue. Can you please post your HTML code?
Thanks.
-Goalie35
|
|
|
|
|
I am builing a application,there are different type of roles like administrator,guest,user and
i want to display only certain features certain users based on Roles how do this in GUI in ASP.NET 2.0 .Thanks in advance
jrsreenivas@hotmail.com
|
|
|
|
|
This is quite wide topic, but generaly you need to have Role class with method IsUserInRole(...),
then you can display/hide controls in accordance with what this method returns. Do not reinvent wheel, see .NET Provider model:
http://odetocode.com/Articles/427.aspx
Pilo
|
|
|
|
|
|
This article[^] details how to retrieve an image from a database.
Basically, you create an aspx page called something like LoadImage.aspx.
The LoadImage.aspx page contains the code to get the image from the database (the aspx page content doesn't matter as it gets replaced by the image data).
private void ShowImageData(byte[] imageData)
{
Response.Clear();
Response.ContentType = "image/jpeg";
Response.OutputStream.Write(imageData, 0, imageData.Length);
Response.End();
}
Then in you web page where you want to display the image, you just put a link to the image: e.g. where the imageID is the image id in the database to load. This would be accessed in the Page_Load of LoadImage.aspx
ChrisB
|
|
|
|
|
|
Is it possible to display checkbox value in display like first,next...buttons.
watever the value it has that sholud display using any background color for that perticular value...or any other idea.
I need to display the checkbox valued also in record navigation.
Thanks in advance
kissy
|
|
|
|
|
Hi all
Some body help me
I am building a project by ASP.Net (VS2005) Framework 2.0
I have use GridView, When i use GridView have Datasource = SqlDataSource so VS2005 support
afterthat i add CommandFiel is "Edit, update, cancel" and use Event "GridViewUpdateEventArgs"
void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string[] strValues = new string[3];
int i = 0;
foreach (DictionaryEntry entry in e.NewValues)
{
strValues[i] = Server.HtmlEncode(entry.Value.ToString());
i = i + 1;
}
}
When i use GridView have "Datasource = SqlDataSource" so strValues[i] have value
but when i dont use "SqlDataSource" so i get data to database by
string strQuery = "Select * from Categories";
SqlConnection connect = new SqlConnection(strConnection);
SqlDataAdapter da = new SqlDataAdapter(strQuery, connect);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = Datatable;
GridView1.DataBind();
strValues[i] haven't value and it not run to loop "foreach"
I want get value to gridview and update to database don't use SqlDataSource so by command
|
|
|
|
|
Hi there,
This is one of the advantages of using the DataSource control, that said the NewValues dictionary is only populated when you use the GridView control with a datasource control like the SqlDataSource. So in your case, you need to manually get the new values from the input controls in the edit row of the gridview like you did with the datagrid control in the old days.
|
|
|
|
|
|
Hello,
Can anybody show me how I will going to make a log-in page that will use Active Directory for authentication.
I really appreciate your help. Thanks in advance.
-- modified at 5:20 Thursday 5th October, 2006
|
|
|
|
|
|
Hi...thanks for your help but do you have any idea if I want to authenticate all users with different domain controller? without setting any userid and password?
Our scenario is we have different domain controller. We want to have a web page log-in that will have different access depending on the domain they will log. Our Active Directory ID password is reset every month and I only have an access to only one domain so I cannot use configuration with user id and password parameter.
Thanks for your help again in advance.
|
|
|
|
|
Hi
given below code is to display searched records.
problem is that it displays correctly in only first page.
when i click next.it displays all records.
such as if would search job:Developer and country:USA.
it displays correctly in only on first page.when i click on next. it displays all records from all country and all job.
please help me out
string jobs = txtjob.Text;
string jobsdesc = ddcoun.SelectedValue ;
string sqlstmt = "select * from employer_eng where ( job LIKE '%" + jobs +"%' or job_desc LIKE '%" + jobs +"%' ) And cou_name_ar='" + jobsdesc + "'" + " "+ "And" + " " + "approval='Y'";
SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["DBConnection"]);
SqlCommand cmd = new SqlCommand(sqlstmt ,conn);
conn.Open();
//conn.Open();
//DataGrid1.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection);
//DataGrid1.DataBind();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds=new DataSet();
sda.Fill(ds);
PagedDataSource pgds1 = new PagedDataSource();
pgds1.DataSource = ds.Tables[0].DefaultView;
pgds1.AllowPaging = true;
pgds1.PageSize = 10;
int CurPage;
if (Request.QueryString["Page"] != null)
CurPage=Convert.ToInt32(Request.QueryString["Page"]);
else
CurPage=1;
pgds1.CurrentPageIndex = CurPage-1;
lblsearch.Text = "Page: " + CurPage.ToString();
if (!pgds1.IsFirstPage)
searchp.NavigateUrl=Request.CurrentExecutionFilePath
+ "?Page=" + Convert.ToString(CurPage-1) + "&j=" + jobs + "&d=" + jobsdesc;
if (!pgds1.IsLastPage)
searchn.NavigateUrl=Request.CurrentExecutionFilePath
+ "?Page=" + Convert.ToString(CurPage+1) + "&j=" + jobs + "&d=" + jobsdesc;
repsearch.DataSource = pgds1;
repsearch.DataBind();
cmd.Dispose();
conn.Close();
|
|
|
|
|
|
hi dear
i need to construct a regular expression by using which i can restrict user to only enter value which is prefixed e.g.
i need to construct a regular expression to accept only one value between three 'input_1','input_2','input_3'...
hope u got that.
waiting for a postive reply
regards
vishal
regards
Thanks & Regards
Vishal Sharma
vishalsharma556@yahoo.co.in
|
|
|
|
|
I don't have an answer, but I can give you some hints to get you started, you can download the Expresso[^] with the tutorials posted here at CP.
|
|
|
|
|
Hi,
I wish to implement the PostBack to the Same Page, BUT with Different Data Values. (I am Passing the Data in URL).
When i click on some server control (for ex Anchor,LinkButton & <a href=""> ), the URL need to be modified immediately.
For example, I m having 10 pages numbered 1,2,3,..10 (conside each page no as any one Navigation control), and when i clicked on the no 1, immediately the URL's page value need to be changed to 1. Like this for all page no. BUT before the PostBack occurs.
xyz.aspx?page=1
B'Coz, in my Page_Load event handler i wish to get that page value using Request.QueryString["page"] .
How to achieve this? Which CONTROL i have to use for PostBack to occur to the same page WITH modified URL value?? OR any other solution for this?
Regards,
Jay
|
|
|
|
|
u can initialize the page variable on the first page Page_Load and then increment and decrement that variable depending on what u need
as for the postback thing ... i'm not sure about it
Best Regards
3ala2
|
|
|
|
|
Hi,
Thanks for your suggestion. But i have to SET the Page value in URL only, B'coz it has used for many other purposes in the aspx Page.
Now i have used LinkButton Control and set its PostBackUrl property in the Page_Load event handler.
string pageIndex= Request.QueryString["page"].ToString();<br />
LinkButtonID.PostBackUrl= "Products.aspx?&page="+pageIndex;
The thing is that, i have to check for Page.IsPostBack in the Page_Load.It works fine. Previously my problrm is that, i have set it in the Click event handler of each LinkButton.
-- modified at 0:19 Friday 6th October, 2006
Regards,
Jay
|
|
|
|
|
I have a button in one page,when i clicked on that button,a pop window will open,in that popup i have a text area,ok,cancel buttons,i want to give the input to the textarea and click ok button,the popup willclose automatically,and comes to the first page click button function
Meanwhile the firstpage server execution stops when the popup is called
How to stops the firstpage server execution and starts automatically when the popups ok button clicked
Thanks&Regards
Srilakshmi
|
|
|
|
|
Why do you want the main to stop working? What does it do when you open the pop-up window? IMO, you may simply use the showModalDialog method to pop up the window and while he's working on this pop up he cannot access the main page.
|
|
|
|