|
Use Typed Dataset to fill data.
|
|
|
|
|
I am trying to insert dataset as xml datatype,although the query is working fine, I am getting error in the application.
error:Cannot drop the table '#temp2', because it does not exist or you do not have permission.
I have tried alot to fix this..every thing in my query seems fine.adding the Query below:
create table #temp2 (JobID int,winnerId int,Title Nvarchar(50),FirstName nvarchar(50),LastName nvarchar(50),
Destination nvarchar(50),DateBooked datetime,DateDeparture datetime,Operators nvarchar(50),PhoneHome nchar(25),
PhoneWork nchar(25),Address nvarchar(200),TCAT nvarchar(50),Notes nvarchar(50),LastModifiedBy nvarchar(50),LastModifiedDate datetime)
insert into #temp2
SELECT
Data.Col.value('JobID[1]','int')as JobID,
Data.Col.value('WinnerID[1]','int')as WinnerID,
Data.Col.value('Title[1]','nvarchar(50)')as Title,
Data.Col.value('FirstName[1]','nvarchar(50)')as FirstName,
Data.Col.value('LastName[1]','nvarchar(50)')as LastName,
Data.Col.value('Destination[1]','nvarchar(50)')as Destination,
convert(datetime, left(Data.Col.value('DateBooked[1]','varchar(50)'),10)) as DateBooked,
convert(datetime, left(Data.Col.value('DateDeparture[1]','varchar(50)'),10)) as DateDeparture,
Data.Col.value('Operators[1]','nvarchar(50)')as Operators,
Data.Col.value('PhoneHome[1]','nchar(25)')as PhoneHome,
Data.Col.value('PhoneWork[1]','nchar(25)')as PhoneWork,
Data.Col.value('Address[1]','nvarchar(200)')as Address,
Data.Col.value('TCAT[1]','nvarchar(50)')as TCAT,
Data.Col.value('Notes[1]','nvarchar(50)')as Notes,
Data.Col.value('LastModifiedBy[1]','nvarchar(50)')as LastModifiedBy,
convert(datetime, left(Data.Col.value('LastModifiedDate[1]','varchar(50)'),10)) as LastModifiedDate
FROM @Winnerpersonal.nodes('/NewDataSet/WPersonal') AS Data(Col)
insert into tbl_WinnerPersonal(JobID,Title,FirstName,LastName,Destination,DateBooked,DateDeparture,Operators,PhoneHome,PhoneWork,Address,TCAT,Notes,LastModifiedBy,LastModifiedDate)
select @JobID,Title,FirstName,LastName,Destination,DateBooked,DateDeparture,Operators,PhoneHome,PhoneWork,
Address,TCAT,Notes,LastModifiedBy,LastModifiedDate from #temp2 where WinnerID < 0
drop table #temp2
CAn any one know wherer I went wrong??
|
|
|
|
|
bigphish wrote: CAn any one know wherer I went wrong??
Yes. Posting a SQL Server question to the ASP.NET forum
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Temp tables are destroyed after the sessions ends, so you may want to try removing the explicit "drop table #temp2". And see if things work.
You can verify whether the table is present or not by using the following command:
select name
from tempdb..sysobjects
where name = '#Temp2'
Step through your code and you should see the table being created, then automatically destroyed for you when the session ends.
Refer to this article for some additional info on temp tables: http://www.sqlteam.com/article/temporary-tables[^]
Good luck.
|
|
|
|
|
IIRC, the table variable is preferred to temp tables. Similar syntax:
DECLARE @temp2 TABLE (JobID int,winnerId int,Title Nvarchar(50),FirstName nvarchar(50),LastName nvarchar(50),
Destination nvarchar(50),DateBooked datetime,DateDeparture datetime,Operators nvarchar(50),PhoneHome nchar(25),
PhoneWork nchar(25),Address nvarchar(200),TCAT nvarchar(50),Notes nvarchar(50),LastModifiedBy nvarchar(50),LastModifiedDate datetime);
Now no need to drop
|
|
|
|
|
HI All,
i have one application
url of this application : http://a.aspx this is accessible t one user.
this web site contains the other page also such as B.aspx , C.aspx buy these page are not accessible
but once user change the URL from browser he is able to access the page.
how to stop this is there any role management needed.
Thanks,
amit
|
|
|
|
|
Here is a web.config copy and past. Change the allow user element to suit your needs.
<location path="A.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="B.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="C.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
|
|
|
|
|
Hi
I am having problem for Page.PreviousPage where I am getting all the values from next page to previous page. But I want to close the next page and I want to fully transfer the control to the previous page.
I tried with response.redirect and server.transfer but in the same(next) page i am getting the updated result.
Thanks
Sjs
|
|
|
|
|
Dear all,
I am using vs 2005, asp.net with c#. I have deploy a web application into a microsoft server 2008 .The application allow user to upload and download documents. Now,my question is how to enable user to edit those server's documents(ms word,excel and power point) via online like what google docs and office live workspace did.
Any tips and suggestion are welcome.
Thanks and regards
Cocoonwls
|
|
|
|
|
cocoonwls wrote: Any tips and suggestion are welcome.
1) Get 100 million dollars
2) Hire 20 senior developers (200 junior developers if offshore)
3) Spend 10 years developing (15 years of offshore)
4) Realize you are now 10 years behind
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Mark,
Thanks for your advise.But unfortunally..i don't have 100 million dollars (might be few years after..),thus can't hire developers..
Regards
|
|
|
|
|
|
Hi Jinal,
Thanks for your reply. Now i got it ,and it is very difficult task for me currently..so,i will use other way to replace this problem. Beside this, do you know any thrid party component can help me acomplish this task?
Regards
cocoonwls
|
|
|
|
|
What i try is to get 2 RepeaterItems in one Item...
I guess its possible or not?
Here is my Code but my page still always empty
Repeater getGroupRepeater = (Repeater)sender;
for (int i = 0; i < getGroupRepeater.Items.Count; i += 2)
{
RepeaterItem item = new RepeaterItem(i, ListItemType.Item);
if (i != getGroupRepeater.Items.Count - 1)
{
item.Controls.Add(getGroupRepeater.Items[i]);
item.Controls.Add(getGroupRepeater.Items[i + 1]);
}
else if (i == getGroupRepeater.Items.Count - 1)
{
item.Controls.Add(getGroupRepeater.Items[i]);
}
getGroupRepeater.ItemTemplate.InstantiateIn(item);
}
|
|
|
|
|
(Posted on behalf of a colleague - for reference purposes, I am the system admin)
I have a .NET 2 web application which I'm trying to deploy. I published the project to a folder on the production web server, but got the popular "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level." error.
I said, "I know how to solve this." I cranked up the IIS manager, drilled down to the project's folder, and clicked the "Create" button to make the site it's own application. Problem solved.
Then the site administrator stopped me and said that the site could not remain in production as a separate application. At that point, things got interesting.
I Googled extensively and found lots of references to solving this problem the way I did it by creating an application, but nothing about what to do if that wasn't an option. There are several which say I can move the web.config closer to the root of the main site, but not a lot of info about how to actually get the site working that way.
Moving web.config out of my app's folder starts causing errors leading me to believe it can't find all it's components.
A couple other points worth noting: the bulk of the root site is classic ASP and there are other .NET sites embedded in other folders deeper in the tree already (system admin pointed this out immediately). The existing sites are uncompiled, single-page affairs. Their web.config files are in the folder one level up in the tree from the app- still several levels below the root. My app is multipage, AJAX enabled, and makes heavy use of custom controls.
So, I either need instructions on how to successfully move my web.config up towards the root of the base ASP site, or a I need a good excuse why it can't or shouldn't be done this way which I can sell to the system admin.
EDIT ON
The Intranet is a menued environment with integrated security and logging; allowing access directly to a portion of the system bypasses these provisions. This is not just my call, it is the opinion of the department manager
EDIT OFF
Any ideas?
Thanks,
Tim
modified on Tuesday, June 29, 2010 10:12 AM
|
|
|
|
|
Tim Carmichael wrote: Then the site administrator stopped me and said that the site could not remain in production as a separate application.
Why?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Unfortunately, it would seem no matter what you present it would be difficult to convince the site admin otherwise if he has not already used separate ASP.NET applications. One big reason I can think of is the ability to separate the worker pools so the asp site doesn't bring down all the other sites and visa versa, plus, better memory utilization, app recycling, and others.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,some one help me on this. I am using facebook connect in one of my site. I was create one application in my facebook and used that application in my site and also given all permission.
using facebook connect I can able to get all my friends list in my site. I select one friend from the list and post some message now I got the error “Requires extended permission: share_item”.
I have given all the permission like using below link
http://facebook.com/authorize.php?api_key=12dxxxxxxxxxxxxxxx76134&v=1.0&ext_perm=publish_stream
http://facebook.com/authorize.php?api_key=12dxxxxxxxxxxxxxxx76134&v=1.0&ext_perm=share_item
I am using this code in my application
api.Links.Post(uid, url, HeadingMsg);
please have a look and help me on this.
Regards,
Praveen.
Praveen Kumar.R
|
|
|
|
|
Hi guys,
Am using com objects in my project to create a word document
that only has a simple table and a pie chart.
I create all this via asp.net.
But when i make my site live, it looks my clients cannot start COM objects on the
server side...everything runs well on my local machine.
Is there something(a tool or .dll) i can use to create word documents?
rather than fighting with com objects?
or is there something that i need to know about com objects when clients
make request to the server to create a word document?
I have tried google and most of the articles want me to use com objects
to create a simple word document
Please help me
|
|
|
|
|
You won't be able to use a COM object on a live web server for this purpose unless Word is also installed there (and I strongly suspect it isn't - for licencing reasons if nothing else...)
You really need to use a third-party component - try Googling for ".net Word component" - but don't expect to find anything that is any good without having to pay (quite a lot) for it.
|
|
|
|
|
Thanks man,
I have the whole office package installed on my server....either way
iam not looking forward to working with com objects to create word docs....
Thanks for your help
|
|
|
|
|
You can use OpenXML SDK to create word document on the fly on server side, there is no need to install MS office in server.
|
|
|
|
|
Hi I want to bind checkbox list with a datatable with select/deselect function corresponding in datatable rows deletion(deselect) insertion(select with duplicate row avoidance). Anyone has a working example ?
|
|
|
|
|
Anybody ?
|
|
|
|
|
Hi All,
I am using Data set to get value from the data base using following code.
<pre>
DataSet ds = new DataSet();
String connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
MySqlDataAdapter mySqlDataAdapter = new MySqlDataAdapter(query, connectionString);
mySqlDataAdapter.Fill(ds);
</pre>
once i get this i want filter with another query
how to add do this.
Thanks,
Amit
|
|
|
|
|