|
Hi All,
suppose i have one table which has
pk and name column
so when i insert data into the table
1 a
2 b
now if i perform insert operation
then next
pk will be 3 so how to get this id
MAX function will not work because user can insert from more than 1 place
Thanks and regards,
Amit Patel
|
|
|
|
|
Use @@IDENTITY or SCOPE_IDENTITY
|
|
|
|
|
can u please give me example??i will be very thankful to u.
Thanks and regards,
Amit Patel
|
|
|
|
|
I hope u r using SQL Server, and SP for inserting records, after the insert statement return @@IDENTITY
BEGIN
INSERT INTO TABLE VALUES (A,B,C);
RETURN @@IDENTITY
END
|
|
|
|
|
When we manipulate a url ( eg: 'http://www.codeproject.com/default.aspx' to 'http://www.codeproject.com/default.aspx/' [with a trailing slash] ), the UI gets distorted i.e, displaying the UI without styles specified in external css.
Please Help
|
|
|
|
|
but why you need to do it.
|
|
|
|
|
In the codeproject site, if we enter trailing slash the website will redirect to 'page not found'. I want similar option
|
|
|
|
|
for this you have to done a setting in iis i.e. if any trailing slash comes even after directory page will redirect to some defined page.
|
|
|
|
|
Can u help me how to set this on IIS
|
|
|
|
|
Hi
I'm generally looking for a bit of guidance to the scenario below as I am not sure of the best path to take.
I am creating an ASP site which needs to meet the following requirements:
•Will connect to a database
•Database data needs to be displayed in a custom layout (so no table/grid layout)
•Some of the displayed data will be read-only, so will only be displayed. Other data will need the option to be edited by the user.
•It is possible in the future that some of the read-only data will need to be updated to provide the ability to be edited by the user.
•Program functionality wise I need the ability to read certain values from the retrieved database data.
•Site needs to be as secure as possible.
A simple example could be contact details and car parts. The car parts will be read-only at present and the contact details will be the data that can be edited. In the future it is possible that the car parts could be edited by the user.
The issues I am trying to decide on are:
Which will be the best method to implement which will allow the least amount of code change in the future when the read-only fields need to be edited:-
•Should I go down the SQLDataSource route and bind these to a detailsview/datalist. (As I have only been using ASP for a limited time I'm not sure if I'm able to change the layout of these web controls enough using either CSS or the properties options to meet the display requirements of the site).
•Should I go down the DataSet and TableAdapter route where I can read the data retrieved from the database and the set 'Text' properties of, for example, label controls. I know this is probably the easiest method for reading certain values from the retrieved data.
I realise each method allows me to add in extra functionality in the future to allow the user to update/insert into the database, but I'm not sure which will be the best method for my requirements.
I am kind of leaning towards the DataSet/TableAdapter route, but feel I may not be aware to the full potential of the SQLDatasource method. Any help or advice is much appreciated.
Thanks
|
|
|
|
|
Hi guys,
Two years I was out of .Net and was doing code in Perl and do not know much about the latest happenings in the .Net world
Now, I got a requirement to code. The requirement is to change the database table data of field 1 to that of field 2.
They want to achieve it by displaying both the data of table 1 and 2 in a gridview. drag gridview1 over gridview2 and then gridview 2 will be overwritten by gridview1 also the underlying database table.
What are the possibilities of achieving it? I am told to use JQuery and Ajax.
Any directions to articles or suggestions would be much appreciated.
Thank You!
-Afsal
|
|
|
|
|
|
Hello,
My code is:
if (!IsPostBack)
{
ds = cn.MasterBind("select * from TblEmp");
if (ds.Tables[0].Rows.Count > 0)
{
lstEmp.DataSource = ds.Tables[0];
lstEmp.DataBind();
dp1.Visible = true;
dp1.SetPageProperties(0, dp1.MaximumRows, false);
//ClearState();
}
}
i set datapager setproperties in page load and also i set on search button click event.
dp1.SetPageProperties(0, dp1.MaximumRows, false);
lstEmp.DataSource = dsParent.Tables[0];
lstEmp.DataBind();
But my search result will not display on first index of datapager.On first index my previous data is displayed when i click on 2 page,my search result is displayed.
i also set false to true but it doesn't work.
Do u have any suggestion,pls help me.
Thanks
|
|
|
|
|
Set property of Datapager after binding your "lstEmp" on click of your Search button. As below
lstEmp.DataSource = dsParent.Tables[0];
lstEmp.DataBind();
dp1.visible = true;
dp1.SetPageProperties(0, dp1.MaximumRows, false);
Its just a guess. I dont have time to check this out. Please give a try once. Rashmi.M.K
|
|
|
|
|
hi everybody,
i want to display weather forecast for two days for any city world wide. user will enter city in textbox and then weather forecast for that partiular city will be shown.i have searched a lot but no luck
thanks
|
|
|
|
|
One way would be to utilise a web service that provides this type of information (for which you may have to pay a fee). Have a look at WebserviceX.NET[^]. They may have something to get you started.Tychotics
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
There must be many News website which are providing this information as RSS Feed.
Just get those RSS feed and display in your website. If you wish to know about RSS feed, you may google it and you will find examples a lot there.
|
|
|
|
|
we are building a web application and when the user logs into the web application, we want to detect if our software is installed on the client machine and if so we want to provide more access, or else we want to give the user a limited access to the web site
|
|
|
|
|
First enter a value in the registry when u install the software.
depending on the registry value u can set the access .Its only an idea..!
Accessing registry in asp.net[^]
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
It is bad practice to access the Local Registry from a Web App. The code link you posted is for running on the server.
You can access the local registry using VBScript but expect it to fail with lack of cross browser, and cross platform support, along with the inevitable security warnings.
|
|
|
|
|
Yes its a good Point..!
its possible with active x controls...|
Do you have any other idea..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
modified on Wednesday, March 10, 2010 6:30 AM
|
|
|
|
|
Hi guys,
I have customer database with about 30 fields in it.
I need to develop search facility for it.
I have tried using some queries like below
Select * from customer where name like '%' + @search + '%' ( similarly for all the fields in the same query)
But u know that this is not efficient search....
Let says client name is "Erina Art Clubs and Pubs"...............if i search for "ART", result is found but
if i search for "art erina" it wont come up............
Can you suggest me some better searching techniques combining sql and vb.net programming..........include some examples
Thanks
|
|
|
|
|
|
i tried that now.............it worked.
bt does it affect the performance of the server.......???
|
|
|
|
|
Full Text search gives you better performance compared to the conventional query using "like".
Read those articles completely for details.
|
|
|
|