Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Friday, March 30, 2012

how can i connect to sqlserver express manually when i use text boxed

hi guys,


i am very happy that i found this forum which discuss ASP.net.
i am new to ASP.net 2.0 and some need serious help. when i debug my application and try to insert data an error occur saying:

"Cannot open database "ecb" requested by the login. The login failed. Login failed for user 'HOME-USER\user'."

the code that i have used to submit data is as follow:

Imports System.Data.SqlClient
...
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

Dim objConn As SqlConnection
Dim objCmd As SqlCommand

objconn =New SqlConnection("data source= localhost\sqlexpress; initial catalog =ecb; persist security info =true; trusted_connection=true")

objCmd = New SqlCommand("INSERT INTO staff (firstname, surname) VALUES (@.firstname, @.surname,)", objConn)

objCmd.Parameters.Add("@.FirstName", Data.SqlDbType.VarChar).Value = txtFirstName.Text
objCmd.Parameters.Add("@.Surname", Data.SqlDbType.VarChar).Value = txtSurname.Text

objConn.Open()
objCmd.ExecuteNonQuery()
objConn.Close()

i also used this data connection but didn't help:
objconn = New SqlConnection("Server=localhost; Database=ecb;user ID=' ';Password=' ' ") when i use this data

connection i get this message: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

as far as i can remember i have used windows authentication when creating my database in sql server 200 express edition.

the funny thing is that when i use datagrid wizard or dataform the connection is fine ( i mean is automatically done for me but i don't know when i like to do it manually does not work).

can anyone help? thank you in advanced

Hi!

My guess is going to be that you have selected Mixed Authentication mode when you installed the server. Try specifying login details in your connection string. My guess is going to be 'ASPNET' for username and "" for password.

Something else:

What i could recommend you to do is to have a look at this link:http://www.asp.net/default.aspx?tabindex=4&tabid=3000. See Working with "Gridview and Formview"

If you are only updating Firstname and Surnames fields and other basic tasks, then you might rather want to make use of the visual tools in VWD to accomplish this.

|||

hi again:

thank you for your help. Anyway it sounds like is not working. i have tried many many solutions but all failed. however my question here can i uninstall SQL server express edition while keeping hold of the tables that i have done (is quite important)? and then reinstall the application just to make sure that the authentication level i will use is correct ( because i can't remember whether i have used sql server authentication or windows based authentication.!!!

do you thing is a good solution? if yes would you please tell me how to keep the tables and uninstall the application?

Many thanks saif44

|||

If you have created the website in your file system then its all fine. If you really want to then just make a back up of the folder.

You can go ahead and do a re-installation.

It really hard to say if its a good solution. I cant say. It's def worth a tryWink [;)]

|||

Hello Saif,

This might help, I was having the same issue and this is one way to figure out your connection string.

Use your datagrid wizard and create a valid connection and make sure it works, then go back to your datagrid and go to configure data source.

This takes you to choose your data connection menu and the current connection that your datagid is using will be selected in the drop down list. Below the drop down list is a box with a + and the words connection string across from it. Click the + button and the connection string that was generated by the wizard will be shown. That should be your valid connection string that works.

A nicer way of doing it is to create the connection string in the web.config file and then reference the connection string name in your code.

for example in my web.config file I have this connection string:

<connectionStrings>

<removename="LocalSqlServer"/>

<addname="LocalSqlServer"connectionString="Server=[your server name];Database=[ur dbase name];User ID=;Password=;Trusted_Connection=False"/>

</connectionString>

Now I can reference the connection string programatical in my code as such:

Using connectionAsNew SqlConnection(ConfigurationManager.ConnectionStrings"LocalSqlServer").ConnectionString)

....[my code here]

end using

Of course this is just a short explanation, hopefully it gets you in the right direction.

The best resource I have found for asp.net is from 4guysfromRolla.com, this is their article on connection to a database:

http://aspnet.4guysfromrolla.com/articles/022206-1.aspx

thanks,

manny

|||Thank you very very much Manny. the problem is sloved. However, there is another problem with

objCmd.ExecuteNonQuery() it triggers a message saying "Invalid object name 'staff ' ". i don't know why this is happening?' Staff ' is the name of my table i am using and its syntax is correct.

please can you review this code for me and tell me what's wrong with it:

............

objconn =New SqlConnection(ConfigurationManager.ConnectionStrings("localsqlserver").ConnectionString)

objCmd =New SqlCommand("INSERT INTO staff(staffno, FirstName, Surname, DateRegistered) _

values (@.staffno, @.firstname, @.surname, @.dateregistered)", objconn

objCmd.Parameters.Add("@.StaffNo", Data.SqlDbType.Int).Value = txtStaffNo.Text

objCmd.Parameters.Add("@.FirstName", Data.SqlDbType.VarChar).Value = txtFirstName.Text

objCmd.Parameters.Add("@.Surname", Data.SqlDbType.VarChar).Value = txtSurname.Text

objCmd.Parameters.Add("@.DateRegistered", Data.SqlDbType.SmallDateTime).Value = txtRegDate.Text

objConn.Open()

objCmd.ExecuteNonQuery()

objConn.Close()

Response.Redirect("addstaff.aspx")

I have to say here that i am using an automatic insertion of the StaffNo when i first created the data definition table. do you think the code above is correct for the StaffNo? and what do you think it does cause the above error message to be trigged.

thank you very much for your help

how can I connect to .MDF through 2 applications?

Here is the big problem:

    I am using ASP.NET 2.0 login control. this control connect to ASPNET.MDF database.I built another application using windows service, and this application also connects to ASPNET.MDF database.

problem is that the first application that connects to the database, locks the database, and so the other application cannot use the database untill the other application is closed.

I am going on circles about this, and just don't know what to do.

Please please please. love me do.Big Smile

I don't think you can use the membership database for none Asp.net application because a console application is not Asp.net application, but if you could maybe you should create one for each application as the link below from a Microsoft security forum. The reason is by default every application uses the same application name to access the database so why not create one for each application so it is clean. Post again if you still have question. Hope this helps.

http://aspalliance.com/groups/microsoft_public_dotnet_framework_aspnet_security/ng-645637_Membership_Database_Security.aspx

sql

how can i connect tables.

Hi,

How do i connect tables so they are interrelated to each other. like the asp.net 2.0 membership tables have the "id"

and how can i use that?

i have multiple tables that are all connected.

like i have a table for profile. and images

profile with include their profile, while images will include there avatar.

now when i display there profile on page, i need to grab the data from both the profile table and avatar.

right now i've been using the "JOIN" statement. but is tehre any other way

only join is made in sql for getting information from interrelated tables in database.

use inner/outer as per your requirement.

thanks

vishal sharma

|||

Hello my friend,

The JOIN is the "de-facto" way of getting related data and saves you from having to do 2 or more separate queries. Some info on joins: -

FROM profile INNER JOIN images ... - if profile does not have an image or vice versa, no records will be returned.

FROM profile LEFT OUTER JOIN images - if profile exists but image does not, a record will be returned with the image fields as NULL. Profile record must exist.

FROM profile RIGHT OUTER JOIN images - if image exists but profile does not, a record will be returned with the profile fields as NULL. Image record must exist.

Kind regards

Scotty

|||

masfenix:

right now i've been using the "JOIN" statement. but is tehre any other way

- Yeah, you can do a SubSelect if you are doing something simple like getting 1 value from 1 table instead of JOINing to that table.

Example:

SELECT
*,
(SELECT TOP 1 Blah FROM myOtherTable WHERE myOtherTable.UserID = myTable.UserID)
FROM
dbo.MyTable

|||

so is what is it?

is it not join?

|||

join is better option.

other thing you can do is

select tableA.field, tableB.field where tableA.Id = tableB.Id something like that.

thanks,

satish

|||

You can see an example of when you would use JOINing or SubSelects of what I posted above can be found in this article :http://www.singingeels.com/Articles/How_To_Maintain_Customer_Payment_History.aspx

Monday, March 26, 2012

How Can I call SQL Server SMO Objects in VC6 or VB6

How Can I call SQL Server SMO Objects in VC6 or VB6

Hi

I want to use SQL SMO (SQL Management Object .Net Library) in VC 6.0 and VB.6.0

I don’t want to use SQL DMO (COM component)

I tried to make COM callable wrapper (CCW) for SMO using the following command line execution.

RegAsm.exe /tlb:MicrosoftSqlServerSmoTest.tlb Microsoft.SqlServer.Smo.dll

After executing the command line RegAsm.exe, I got the following output.

Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42

Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully

Type library exporter warning processing 'Microsoft.SqlServer.Management.Smo.Bac

kupDeviceList, Microsoft.SqlServer.Smo'. Warning: Type library exporter encounte

red a type that derives from a generic class and is not marked as [ClassInterfac

e(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types.

Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and exp

osing an explicit interface as the default interface to COM using the ComDefault

Interface attribute.

Assembly exported to 'C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Mi

crosoftSqlServerSmoTest.tlb', and the type library was registered successfully

In My VB6 Application I have included the Refrence Microsoft_SqlServer_Smo

Then I tried to call Server Object with parameter shown below.

Dim objServer As Server

Set objServer = new Server(Server_Name)

But compile error occurs in the line Set objServer = new Server(Server_Name)


I have the following queries.

  1. How can I access SMO objects in VC 6 or VB6 applications using any method?

  1. How can I solve the compile error?

  1. How can I avoid the Warning when calling the callable wrapper (CCW)?

4. Is it possible to use parameterized constructors in .net components?

  1. Is it necessary that the GUIDs to all .NET objects so that the appropriate COM required registry entries can be created?

For example :

[Guid("2979DBB0-3371-4841-9B94-B79EAE28B503")]

public class TestInteropSample

{

}

Kindly reply me ,

Thanking you,

Kuttappan.

Hello,

I'm having the same problem. Did you ever find a solution?

thanks,

kelly

|||

SMO is only supported in VB/C#.Net 2005. It requires the .Net 2.0 Framework, which isn't available in VB/VC 6.

Friday, March 23, 2012

How Can I call SQL Server SMO Objects in VC6 or VB6

How Can I call SQL Server SMO Objects in VC6 or VB6

Hi

I want to use SQL SMO (SQL Management Object .Net Library) in VC 6.0 and VB.6.0

I don’t want to use SQL DMO (COM component)

I tried to make COM callable wrapper (CCW) for SMO using the following command line execution.

RegAsm.exe /tlb:MicrosoftSqlServerSmoTest.tlb Microsoft.SqlServer.Smo.dll

After executing the command line RegAsm.exe, I got the following output.

Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42

Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully

Type library exporter warning processing 'Microsoft.SqlServer.Management.Smo.Bac

kupDeviceList, Microsoft.SqlServer.Smo'. Warning: Type library exporter encounte

red a type that derives from a generic class and is not marked as [ClassInterfac

e(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types.

Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and exp

osing an explicit interface as the default interface to COM using the ComDefault

Interface attribute.

Assembly exported to 'C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Mi

crosoftSqlServerSmoTest.tlb', and the type library was registered successfully

In My VB6 Application I have included the Refrence Microsoft_SqlServer_Smo

Then I tried to call Server Object with parameter shown below.

Dim objServer As Server

Set objServer = new Server(Server_Name)

But compile error occurs in the line Set objServer = new Server(Server_Name)


I have the following queries.

  1. How can I access SMO objects in VC 6 or VB6 applications using any method?

  1. How can I solve the compile error?

  1. How can I avoid the Warning when calling the callable wrapper (CCW)?

4. Is it possible to use parameterized constructors in .net components?

  1. Is it necessary that the GUIDs to all .NET objects so that the appropriate COM required registry entries can be created?

For example :

[Guid("2979DBB0-3371-4841-9B94-B79EAE28B503")]

public class TestInteropSample

{

}

Kindly reply me ,

Thanking you,

Kuttappan.

Hello,

I'm having the same problem. Did you ever find a solution?

thanks,

kelly

|||

SMO is only supported in VB/C#.Net 2005. It requires the .Net 2.0 Framework, which isn't available in VB/VC 6.

How Can I call SQL Server SMO Objects in VC6 or VB6

How Can I call SQL Server SMO Objects in VC6 or VB6

Hi

I want to use SQL SMO (SQL Management Object .Net Library) in VC 6.0 and VB.6.0

I don’t want to use SQL DMO (COM component)

I tried to make COM callable wrapper (CCW) for SMO using the following command line execution.

RegAsm.exe /tlb:MicrosoftSqlServerSmoTest.tlb Microsoft.SqlServer.Smo.dll

After executing the command line RegAsm.exe, I got the following output.

Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42

Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully

Type library exporter warning processing 'Microsoft.SqlServer.Management.Smo.Bac

kupDeviceList, Microsoft.SqlServer.Smo'. Warning: Type library exporter encounte

red a type that derives from a generic class and is not marked as [ClassInterfac

e(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types.

Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and exp

osing an explicit interface as the default interface to COM using the ComDefault

Interface attribute.

Assembly exported to 'C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Mi

crosoftSqlServerSmoTest.tlb', and the type library was registered successfully

In My VB6 Application I have included the Refrence Microsoft_SqlServer_Smo

Then I tried to call Server Object with parameter shown below.

Dim objServer As Server

Set objServer = new Server(Server_Name)

But compile error occurs in the line Set objServer = new Server(Server_Name)


I have the following queries.

  1. How can I access SMO objects in VC 6 or VB6 applications using any method?

  1. How can I solve the compile error?

  1. How can I avoid the Warning when calling the callable wrapper (CCW)?

4. Is it possible to use parameterized constructors in .net components?

  1. Is it necessary that the GUIDs to all .NET objects so that the appropriate COM required registry entries can be created?

For example :

[Guid("2979DBB0-3371-4841-9B94-B79EAE28B503")]

public class TestInteropSample

{

}

Kindly reply me ,

Thanking you,

Kuttappan.

Hello,

I'm having the same problem. Did you ever find a solution?

thanks,

kelly

|||

SMO is only supported in VB/C#.Net 2005. It requires the .Net 2.0 Framework, which isn't available in VB/VC 6.

how can I bind to only partial columns of a table?

I have the same question. Did you figure our how to do so?
Thank you very much
Yev
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.comalways bind to a view of a table, not directly to a table, so you can contro
l
the columns you want to bind.
MCH
"Yevheniy" wrote:

> I have the same question. Did you figure our how to do so?
> Thank you very much
> Yev
> EggHeadCafe.com - .NET Developer Portal of Choice
> http://www.eggheadcafe.com
>

How can i back-up my database in production environment.

I developed an asp.net application in visual web developer 2005 express edition and SQL sever 2005 express with Advanced services. The application has been deployed and iam wondering what tools are availabel to for backing up my data. Are there any tools i can use to back-up my database. Iam not talking of third party tools but tools a vailable in sql sever 2005 express with advanced services or visual web developer express.

OR can write a vb.net Sub procedure that i run and have my database backed up. If so where can i start or what other options may i explorer.

Hi Dear,

you can backup your datbase by usingMicrosoft SQL Server Management Studio and also by ur VB.NET application

i will try to explain you both ways.

1:By using Microsoft SQL Server Management Studio

Open Management Studio and Right Click On Your Database and go to the Tasks->Backup menu item, Backup Database Dialogbox will be open.

Click Add button in Destination Panel, and choose the Destination File. and simply press OK ( This is the simplest way, but you can customize your backup by choosing different options available on Backup Database Dialog)

2. By VB.NET Application

execute following TSQL statement in your SQL Server

USE

master

EXEC

sp_addumpdevice'disk','MyDataBaseBackup','c:\YourDatabaseBackupDirectory\MyDBBackup.dat'

' and then use following code in your application

' VB.NET Code

Dim conAsNew SqlConnection("ConnectionString")Dim comAsNew SqlCommand("BACKUP DATABASE YourDataBaseName TO MyDataBaseBackup")

com.Connection = con

com.Connection.Open()

com.ExecuteNonQuery()

com.Connection.Close()

Thanks

Regards,

Muhammad Akhtar Shiekh

|||

Oh thanks very much Akhtar,

I want to take on and understand thoroughly the second option(vb.net option) as its looks to be more flexible though a bit complicated. Looks like i have to start with stored procedures, isn't. Please would you point me to a tutorial from microsoft to get me started with the core basics of backingup a database using this approach.

Thanks very much.

|||Check out the BACKUP statement in Books On Line. You might want to schedule it as a job and include it in your weekly maintenance window (if you dont already have one, time to create one) rather than create a VB application for it.|||

The problem all starts with version of sql sever one is using. some of the documentation do not apply to the express version of sql sever so you find your self wasting valuable time reading an article that you later find out does not apply to the product version your running. Iam running sql sever 2005 express edition with advanced sevices in my case.

sql

Wednesday, March 21, 2012

How can I always close a text file from a CLR Stored Procedure even when the process is killed?

I have a C# SQL 2005 .net stored procedure which scrubs a text file looking for characters not in a range of characters and replacing them with another character. This works fine except when the process is killed. When this happens the file handle of the file being scrubbed is not released. I use a try catch finally block when opening the file and the output file. The finally section fiushes the output file and closes all files and streams but still when I go to access the file again or use the file in explorer it says the file is still in use. Should I be handling this some other way? How do I know the files will always be closed correctly.

This behavior could happen because that when you kill the process, your finally section may not be called. Eventually, the file handle will be released when garbage collector kicks in.

How can I add picture in microsoft sql server express 2005?

I would like to store small image in MSSQL server wich I can view by vb .net. For expample: I like to see each customer picture ID as I click on customer name from the customer table.

ThanksQuestion moved to SQL Server Forum.sql

Monday, March 19, 2012

How can I access data to SQL server 2005 using Windows application,ADO.net and .Net remoting.

How can I access data to SQL server 2005 using Windows form application,ADO.net and .Net remoting?

Can anybody help me? please...

This question is too vague. Do you have a specific issue or question?|||

Here is one place to start:

http://www.411asp.net/home/tutorial/howto/applicat

I suggest that you go to your local bookstore or library and look over the options. Or Google?

"create .NET application"

|||

Deepak Kapoor wrote:

This question is too vague. Do you have a specific issue or question?

Hi ! Deepak Kapoor

I am a C# beginner, I have to write some code using windows application,that's need to INSERT,UPDATE,SELECT and DELETE data to sql server using ADO.net and .net remoting...

1.The client application include 1 dataGridView and 4 buttons(Add,Delete,Edit and Load).

2.The server application include 1label and 1 button to start server application.

3.The remote object.

Here are my questions. Big Smile

I already wrote for the Load button of the client application.But, I dont know how to program for the remaining buttons.And I want to access data directly into the dataGridView.If you know how to do,please post some explaination and give me some example code.

This is my remote object.

public class AuthorList : MarshalByRefObject

{

private static string connectionString = @."server = BMSTU\KTS ;database = kts;uid=sa;pwd=";

public DataTable GetAuthors()

{

string SQL = "SELECT * FROM Author";

// Create ADO.NET objects to execute the DB query.

SqlConnection conn = new SqlConnection(connectionString);

SqlCommand cmd = new SqlCommand(SQL, conn);

SqlDataAdapter adapter = new SqlDataAdapter(cmd);

DataSet ds = new DataSet();

// Execute the command.

try

{

conn.Open();

adapter.Fill(ds, "Author");

}

catch (Exception err)

{

Console.WriteLine(err.ToString());

}

finally

{

conn.Close();

}

// Return the first DataTable in the DataSet to the caller.

return ds.Tables["Author"];


}

// This method allows you to verify that the object is running remotely.

public string GetHostLocation()

{

return AppDomain.CurrentDomain.FriendlyName;

}

}

This is the Server application.

private void button1_Click(object sender, EventArgs e)

{

HttpChannel myChannel = new HttpChannel(8080);

ChannelServices.RegisterChannel(myChannel);

RemotingConfiguration.RegisterWellKnownServiceType(typeof(BookServer.AuthorList),

"AuthorList", WellKnownObjectMode.Singleton);

label1.Text = "Server Started";

button1.Enabled = false;

}

This is the Client application

private void btnLoad_Click(object sender, EventArgs e)

{

AuthorList atlst = (AuthorList)Activator.GetObject(typeof(AuthorList),

"http://localhost:8080/AuthorList", WellKnownObjectMode.Singleton);

dataGridView2.DataSource = null;

dataGridView2.DataSource = atlst.GetAuthors();

}

If you know how to program for the btnAdd,btnEdit and btnDelete of the Client application.And how to program in server and remote object.I am hoping anybody's help.

Best regards ,

thanks,

WhoAmI?

|||hmmm, can anyone help me?

Friday, March 9, 2012

How asp.net application communicates with MS SQL database

Hi,

I'm interested in how asp.net application communicates with MS SQL database. I mean, is communication encrypted or can it be? I have scenario where database and web application will communicate over Internet, they are not in the local network.

Please share your opinions.

Yes, you can encrypt the communications. It's easier in SQL Server 2005 than 2000.

Don

How ASP into ASP.NET with SQL server 2000

Dear All,
I'm new on ASP.NET, now trying convert ASP with SQL 2000 into ASP.NET SQL 2000 server.
I facing a problem while read, write, update the SQL command.
like,
rs.open("Select * from tableA"),ocoon, permission,permission
If rs.eof then
rs.addnew()
rs.column1 = "1"
else
rs.column2 = "2"
rs.column3 = "3"
rs.update()
end if
rs.close()
set rs = nothing
this is how to change into ASP.NET with SQL selection and updating command??
Regards,
I would recommend reading up some articles on Data Access in ASP.NET. There are some Tutorials on this site.

Wednesday, March 7, 2012

how 2 install client tools for SQl Server

In Server Explorer of VS .NET 2003, I tried to generate SQL script of the dbo.Portal (ibs)
but got
"To use this feature, you must install the client tols for SQL Server"

When I searched for Help, I've got
"1.Insert the MS SQL Server 2000 compact disc in your CD-ROM drive"

I installed and use MSDE and cannot recall the use of any CD for installation.

1)
Does it mean that I cannot install client tools from MSDE installation?

If not...

2)
I have installation of MS SQL Server200 Enterprise that cannot be installed on Windows Xp Professional that I use. Can I still install "client tools" from Enterprise Ed. for MSDEMSDE !== SQL Server

1. you get the client tools with SQL Server, not with MSDE, which is just the data engine.
2. you should be fine to install the SQL Ent client tools on XP - but it won't let you install the server.|||Thanx, Atrax,
I aslo found in
http://www.microsoft.com/sql/msde/howtobuy/msdeuse.asp


You can only use SQL Server tools and services in conjunction with MSDE if you acquired MSDE through SQL Server 2000 (Developer Edition, Standard Edition, or Enterprise Edition), and if you are using MSDE in conjunction with a properly licensed copy of SQL Server 2000.

I am now in doubt where from I have installed MSDE, since I vaguely recall that I have MSDE installables in various places:
- free downloads
- various editions of SQL Server from CDs,
- MS Office and VS .NET installations
I remember I reinstalled them in various combinations on various PCs.

How can I determine whether MSDE is from Developer, Standard or Enterprise Ed.s or from free download?
Or it is not important?

how 2 insert the value from a SP into a tmp table


can any one advice me on how to insert the results of a SP into a temp
table
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!INSERT INTO #tmp (col1, col2, ...)
EXEC procname
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:u%23myVz9HFHA.3332@.TK2MSFTNGP14.phx.gbl...
>
> can any one advice me on how to insert the results of a SP into a temp
> table
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||Something like
[script]
create table #MyTable(column1,column2,...,columnX)
go
insert into #MyTable (column1,column2,...,columnX) exec MyProcedure
[/script]
Cristian Lefter, SQL Server MVP
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:u%23myVz9HFHA.3332@.TK2MSFTNGP14.phx.gbl...
>
> can any one advice me on how to insert the results of a SP into a temp
> table
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||Emil
INSERT INTO #Temp EXEC sp
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:u%23myVz9HFHA.3332@.TK2MSFTNGP14.phx.gbl...
>
> can any one advice me on how to insert the results of a SP into a temp
> table
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||
evry ting
execp the SP returns 10 vals and i only need to use 2 of them...
how do i do that
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!|||Delete the others from the table after the INSERT. Or, a nasty workaround, i
s to call back to the
SQL Server as a linked server using either OPENQUERY or OPENROWSET and do SE
LECT TOP 2 from that
table valued function.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:u46$uU%23HFHA.1476@.TK2MSFTNGP09.phx.gbl...
>
> evry ting
> execp the SP returns 10 vals and i only need to use 2 of them...
> how do i do that
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||let my try and explain better...itonly returns one row..with 10
Columns..i onle need 2 of those ..not all 10...
thisis my question ...
create table #test
( mktcode int, rttotal float,
)
insert into #test (mktcode, rttotal)
exec sp...but the reslut gives me culmun a,b,c,d,e,f,g,
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!|||Well, with INSERT EXEC you get all. How about modifying the stored procedure
, or extracting the
relevant part of the procedure to make another suitable procedure. Or re-wri
te the procedure into a
table valued user defined function?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:exVfFo%23HFHA.4076@.TK2MSFTNGP10.phx.gbl...
> let my try and explain better...itonly returns one row..with 10
> Columns..i onle need 2 of those ..not all 10...
> thisis my question ...
> create table #test
> ( mktcode int, rttotal float,
> )
> insert into #test (mktcode, rttotal)
> exec sp...but the reslut gives me culmun a,b,c,d,e,f,g,
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||Create a temporary Table Variable, say @.Tmp,
Declare @.Tmp Table (
Col1 Varchar(20),
Col2 Varchar(20),
Col3 Varchar(20),
..
Col10 Varchar(20))
Only make the column definitions match the output of the stored proc.
Then Insert @.Tmp Exec SP -- This inserts all ten values into @.Tmp
Then Insert from @.tmp into your real table.
Insert #test (mktcode, rttotal)
Select Col3, Col 7 From @.tmp -- WHichever 2 columns you want
"Emil Henrico" wrote:

> let my try and explain better...itonly returns one row..with 10
> Columns..i onle need 2 of those ..not all 10...
> thisis my question ...
> create table #test
> ( mktcode int, rttotal float,
> )
> insert into #test (mktcode, rttotal)
> exec sp...but the reslut gives me culmun a,b,c,d,e,f,g,
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
>

Sunday, February 19, 2012

Hot fix 821334

Hi,
Anyone knows where to download the above? The kb article doesn't have a link
to download it.
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @. http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkai
Contact MS Product Support if you need a fix that isn't in a Service Pack.
David Portas
SQL Server MVP
|||Or hang on a little while for SP4. :-)
David Portas
SQL Server MVP
|||http://www.microsoft.com/sql/downloads/2000/sp4.asp
David Portas
SQL Server MVP
|||Thanks
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @. http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkai
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:2_mdnZoBj_RPXObfRVn-vQ@.giganews.com...
> http://www.microsoft.com/sql/downloads/2000/sp4.asp
> --
> David Portas
> SQL Server MVP
> --
>

Hot fix 821334

Hi,
Anyone knows where to download the above? The kb article doesn't have a link
to download it.
--
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @. http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkaiHello Loke,
you could contact Microsoft Product Support Services directly to obtain the
fix. For a complete list of Microsoft Product Support Services phone
numbers and information about support costs, visit the following Microsoft
Web site:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
NOTE: In special cases, charges that are ordinarily incurred for support
calls may be canceled if a Microsoft Support Professional determines that a
specific update will resolve your problem. The typical support costs will
apply to additional support questions and issues that do not qualify for
the specific update in question.
Thanks & Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
| From: "Loke Kit Kai" <kitkai@.community.nospam>
| Subject: Hot fix 821334
| Date: Fri, 6 May 2005 11:16:07 +0800
| Lines: 14
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| X-RFC2646: Format=Flowed; Original
| Message-ID: <eeYtzneUFHA.544@.TK2MSFTNGP15.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: 203.118.60.18
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.reportingsvcs:42947
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Hi,
| Anyone knows where to download the above? The kb article doesn't have a
link
| to download it.
|
|
| --
| Best Regards,
| Kit Kai
| MVP (asp.net)
| SgDotNet Council Member
| Visit Us @. http://www.sgdotnet.org
| My Blog: http://community.sgdotnet.org/blogs/kitkai
|
|
||||Hi Peter,
I just called the PSS, but they say there is not such hotfix. Could you help
me check please?
--
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @. http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkai
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:KwS4EOgUFHA.3928@.TK2MSFTNGXA01.phx.gbl...
> Hello Loke,
> you could contact Microsoft Product Support Services directly to obtain
> the
> fix. For a complete list of Microsoft Product Support Services phone
> numbers and information about support costs, visit the following Microsoft
> Web site:
> http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
> NOTE: In special cases, charges that are ordinarily incurred for support
> calls may be canceled if a Microsoft Support Professional determines that
> a
> specific update will resolve your problem. The typical support costs will
> apply to additional support questions and issues that do not qualify for
> the specific update in question.
> Thanks & Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
> --
> | From: "Loke Kit Kai" <kitkai@.community.nospam>
> | Subject: Hot fix 821334
> | Date: Fri, 6 May 2005 11:16:07 +0800
> | Lines: 14
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
> | X-RFC2646: Format=Flowed; Original
> | Message-ID: <eeYtzneUFHA.544@.TK2MSFTNGP15.phx.gbl>
> | Newsgroups: microsoft.public.sqlserver.reportingsvcs
> | NNTP-Posting-Host: 203.118.60.18
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.sqlserver.reportingsvcs:42947
> | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
> |
> | Hi,
> | Anyone knows where to download the above? The kb article doesn't have a
> link
> | to download it.
> |
> |
> | --
> | Best Regards,
> | Kit Kai
> | MVP (asp.net)
> | SgDotNet Council Member
> | Visit Us @. http://www.sgdotnet.org
> | My Blog: http://community.sgdotnet.org/blogs/kitkai
> |
> |
> |
>

Hot fix 821334

Hi,
Anyone knows where to download the above? The kb article doesn't have a link
to download it.
--
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @. http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkaiContact MS Product Support if you need a fix that isn't in a Service Pack.
--
David Portas
SQL Server MVP
--|||Or hang on a little while for SP4. :-)
--
David Portas
SQL Server MVP
--|||http://www.microsoft.com/sql/downloads/2000/sp4.asp
--
David Portas
SQL Server MVP
--|||Thanks :)
--
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @. http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkai
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:2_mdnZoBj_RPXObfRVn-vQ@.giganews.com...
> http://www.microsoft.com/sql/downloads/2000/sp4.asp
> --
> David Portas
> SQL Server MVP
> --
>

Hot fix 821334

Hi,
Anyone knows where to download the above? The kb article doesn't have a link
to download it.
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @. http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkaiContact MS Product Support if you need a fix that isn't in a Service Pack.
David Portas
SQL Server MVP
--|||Or hang on a little while for SP4. :-)
David Portas
SQL Server MVP
--|||http://www.microsoft.com/sql/downloads/2000/sp4.asp
David Portas
SQL Server MVP
--|||Thanks
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @. http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkai
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:2_mdnZoBj_RPXObfRVn-vQ@.giganews.com...
> http://www.microsoft.com/sql/downloads/2000/sp4.asp
> --
> David Portas
> SQL Server MVP
> --
>

Hosting aps.net website, sql server 2005 db in App_data or outsite App_data?

I've started with the development of a website which will use a sql server 2005 database. I want to use the asp.net membership and roles functionality. In the end the website will be hosted by a hosting company.

What is the best way to store the database? In the App_data folder or outstide the App_data folder?

Second, do hosting companies support placing sql server databases stored into the App_data folder?

1) app_data - not good idea. the database file in app_data folder maybe will work for you intranet project but in my opinion it is not good idea. It works great when you want to "play" with VWD and SQL express... BTW SQL express is GREAT so use it but do not create databse file ! - just login to your SQL server and create db. When you finish your project backup db and restore on live server.

2) no ! i mean not the one i know :) i work with 10 diffrent hosts and NO they don't. I guess if you will look for one you will find one... but most hosting companies offers full SQL 2005 servers and they don't support app_data folders. What some hosting companies do, they offer tools that will allow you to copy/upgrade your db to SQL 2005

hope this helps