Hi,
I am struggling to understand how to run the sp_spaceused sproc for all tables in a database.
I know how to use it for one table but how would I replicate it automatically for each table in a given database?
Regards,
Ian.
View Complete Post
I am planning to use Webmatrix as a testing arena for creating and completing the preparation of a website before publishing it. Working with websites on local computer should be much faster than doing that on an online server.
That is why I downloaded a database that I have already created on my online host account, and wanted to import it into webmatrix to continue building my new website using Webmatrix. Here, I did not know how to imort the DB I downloaded from my host, into webmatrix. There is seemingly no way to do that, or to import tables into an existing DB on webmatrix.
Is that not possible?
2- I tried to create a new DB on webmatrix which is a part of installing Wordbress on WM (new site from web gallery --> Wordpress), but I get this error :
The database 'xxxx' could not be created. ---> MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:3306
I have installed PHP 5.2 and Mysql on Webmatrix.
Why does this happen?
In the webMatrix examples, which I have working, it's very easy to access a database. Only three lines are necessary to get up and going:
@{ var db = Database.Open("LOS"); var selectQueryString = "SELECT * FROM wknTest"; }
and a little later,
@foreach(var row in db.Query(selectQueryString)){
There's no using's, no connection strings, all that happens behind the scenes. But now I have enough complicated c# code that I want to separate it into a separate C# file. How would I do the above, but in a C# file residing in the app_code folder in a webMatrix project?
WebMatrix must be creating the Database object behind the scenes. So I'm really asking how do I have access to that.
I'm using the Webmatrix.Data.Database.Query method to return a result set in the following form
var myResult = db.Query("Select * from mytable");
How do you cast myResult to get the count of records returned? I'd like to do something like
myResult.Count
i have a common database for more then one company..
now i want to use Dyanamic Data web sites for data entrys.. but dont know how to filter table records based on company code
Thanx in Advance,
Ramesh
Hello,
I'm in a trouble with the Login Control of ASP.NET to check the credentials against an SQL Database.
I followed all the instructions from http://www.aspxcode.net/free-asp-net-login-source-code.aspx?Topics=How to Login With SQL Server Database but I have errors.
In a master page, I added a Login Control as follows:
<asp:LoginView ID="LoginView1" runat="server"> <AnonymousTemplate> <asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate" BorderPadding="0" BorderStyle="None" BorderWidth="0px" EnableTheming="True" Font-Names="Arial" Font-Size="X-Small" ForeColor="#333333" LoginButtonImageUrl="~/imgs/nav/en/Login.gif" LoginButtonType="Image" TitleText="" TextLayout="TextOnTop" Width="120px" RememberMeText="Remember me."> <CheckBoxStyle VerticalAlign="Middle" HorizontalAlign="Left" /> <InstructionTextStyle Font-Italic="True" ForeColor="Black" /> <LabelStyle HorizontalAlign="Left" Width="130px" /> <LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="None" Font-Names="Arial" Font-Size="X-Small" ForeColor="#284775" CssClass="loginBox" /> <TextBoxStyle Font-Size="X-Small" Width="120px" /> <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="X-Small" ForeColor="White" /> </asp:Login> </AnonymousTemplate> <LoggedInTemplate> <asp:LoginName ID="LoginName1" runat="server" /><br /> <asp:LoginStatus ID="LoginStatus1" runat="server" /> </LoggedInTemplate> </asp:LoginView>
Also, I have implemented an internet found class to the project to connect, OnAuthenticate, to the SQL Database. The code is the following:
Imports System.DataImports System.Data.SqlClientImports System.Web.Configuration
Partial Class how_to_login_with_sql_server Inherits System.Web.UI.MasterPage
&nb
Good morning, this is my first post here.
I will make a system that will be sold at retail, placed in the clouds. The EDMX created from the database seemed the most natural choice since in reality the database exists and is already populated, it has a lot of data.
The First Model did not seem a natural solution since it is difficult today a completely new solution, and the examples I saw did not show me because I use it.
About POCO, what advantages do I have using it?
Thanks,
Bruno
i need links from where i can download northwind database both access and sql format
thanx
In the table, I have ID, name, and photo. After create a new record in the table. I want to change the photo in the record.
In the folder Images, the pix got update. But when I retreive the record to display on the form, it still shows the old image. Why does it like that?
Thanks for any reply here.
Hello All,
I am writing a series of WSS/MOSS webparts amongst which one will need to detect the current SQL Server database connection, prompt the user to setup a new connectionstring, and fire appropriate stored procedures to create a new database if needed.
The user needs to be presented a textbox or label control with the current database connection. I've never had to detect current database connection, what methods do I call for this? If the desirable connection is not present, the web application needs to prompt the user to make a new database. The user really won't make the database, they simply need to click the command button which will fire the stored procedure to create the database.
Please advise this noob on how to do this in a 3.5 webpart. Thanks much for your help and guidance!
Sid