Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts

Tuesday, March 20, 2012

Connection OLAP with VS.NET

Hello,
I'm trying to connect with Analysis Service's Database and create, see,
drop cubes with ASP.NET (programming in VB.NET). What I need to do this?
(I'm beginner with Analysis Server, but already I knew SQL Server).
Thanks.
Gema.You want ADOMD.NET
See this download:
9209e6ac8ad&DisplayLang=en" target="_blank">http://www.microsoft.com/downloads/...&DisplayLang=en
--
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Gema Snchez" <gema.sanchez@.grupo-episteme.com> wrote in message
news:e3AGeYTXFHA.616@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I'm trying to connect with Analysis Service's Database and create, see,
> drop cubes with ASP.NET (programming in VB.NET). What I need to do this?
> (I'm beginner with Analysis Server, but already I knew SQL Server).
> Thanks.
> Gema.
>|||Can I connect only with XML? (ADOMD.NET)
Thanks.
"Dave Wickert [MSFT]" <dwickert@.online.microsoft.com> escribi en el men
saje
news:ueh%23%23OYXFHA.2348@.TK2MSFTNGP14.phx.gbl...
> You want ADOMD.NET
> See this download:
>
layLang=en" target="_blank">http://www.microsoft.com/downloads/... />
layLang=en
> --
> Dave Wickert [MSFT]
> dwickert@.online.microsoft.com
> Program Manager
> BI SystemsTeam
> SQL BI Product Unit (Analysis Services)
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Gema Snchez" <gema.sanchez@.grupo-episteme.com> wrote in message
> news:e3AGeYTXFHA.616@.TK2MSFTNGP12.phx.gbl...
see,[vbcol=seagreen]
>|||Hello Dave,
I've installed ADOMD.NET and that is de way that I want. Thanks. If I
have questions, I'll ask here.
Regards.
"Gema Snchez" <gema.sanchez@.grupo-episteme.com> escribi en el mensaje
news:%23aDqR55XFHA.796@.TK2MSFTNGP10.phx.gbl...
> Can I connect only with XML? (ADOMD.NET)
> Thanks.
> "Dave Wickert [MSFT]" <dwickert@.online.microsoft.com> escribi en el
mensaje
> news:ueh%23%23OYXFHA.2348@.TK2MSFTNGP14.phx.gbl...
>
layLang=en" target="_blank">http://www.microsoft.com/downloads/... />
layLang=en
> rights.
> see,
this?[vbcol=seagreen]
>

Connection OLAP with VS.NET

Hello,
I'm trying to connect with Analysis Service's Database and create, see,
drop cubes with ASP.NET (programming in VB.NET). What I need to do this?
(I'm beginner with Analysis Server, but already I knew SQL Server).
Thanks.
Gema.
You want ADOMD.NET
See this download:
http://www.microsoft.com/downloads/d...DisplayLang=en
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Gema Snchez" <gema.sanchez@.grupo-episteme.com> wrote in message
news:e3AGeYTXFHA.616@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I'm trying to connect with Analysis Service's Database and create, see,
> drop cubes with ASP.NET (programming in VB.NET). What I need to do this?
> (I'm beginner with Analysis Server, but already I knew SQL Server).
> Thanks.
> Gema.
>
|||Can I connect only with XML? (ADOMD.NET)
Thanks.
"Dave Wickert [MSFT]" <dwickert@.online.microsoft.com> escribi en el mensaje
news:ueh%23%23OYXFHA.2348@.TK2MSFTNGP14.phx.gbl...
> You want ADOMD.NET
> See this download:
>
http://www.microsoft.com/downloads/d...DisplayLang=en
> --
> Dave Wickert [MSFT]
> dwickert@.online.microsoft.com
> Program Manager
> BI SystemsTeam
> SQL BI Product Unit (Analysis Services)
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.[vbcol=seagreen]
>
> "Gema Snchez" <gema.sanchez@.grupo-episteme.com> wrote in message
> news:e3AGeYTXFHA.616@.TK2MSFTNGP12.phx.gbl...
see,
>
|||Hello Dave,
I've installed ADOMD.NET and that is de way that I want. Thanks. If I
have questions, I'll ask here.
Regards.
"Gema Snchez" <gema.sanchez@.grupo-episteme.com> escribi en el mensaje
news:%23aDqR55XFHA.796@.TK2MSFTNGP10.phx.gbl...
> Can I connect only with XML? (ADOMD.NET)
> Thanks.
> "Dave Wickert [MSFT]" <dwickert@.online.microsoft.com> escribi en el
mensaje
> news:ueh%23%23OYXFHA.2348@.TK2MSFTNGP14.phx.gbl...
>
http://www.microsoft.com/downloads/d...DisplayLang=en[vbcol=seagreen]
> rights.
> see,
this?
>

Tuesday, February 14, 2012

Connecting to sql2005 using C#

Help... I am new to C# and .net and I am trying to build a insert page with a couple of drop down controls where I pull a categoryID and subcategoryID to populate my dropdown controls from a MS sql2005 express database. I am using a book that only shows how to build the script and access a access database and I am getting this error when trying to pull up the page:

Description:An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message:CS0246: The type or namespace name 'OleDbConnection' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 3: Line 4: <script runat="server" language="C#">Line 5: OleDbConnection objConn = newOleDbConnection(Line 6: "Server=SIMBA\\NETSDK;" +Line 7: "Database=btuniverse;" +


Source File: c:\Inetpub\wwwroot\_addnews.aspx Line: 5

Below is my code and I am not sure what the syntax needs to be when connecting to a ms sql datasource. Thanks in advanced :)

MYCODE:

<%@. Page Language="C#" MasterPageFile="~/main.master" Title="Untitled Page" %>


<script runat="server" language="C#">
OleDbConnection objConn = newOleDbConnection(
"Server=SIMBA\\NETSDK;" +
"Database=btuniverse;" +
"User ID=sa;Password=password");
OleDbCommand objCmd;
OleDbDataReader objRdr;

void Page_Load() {
if (!IsPostBack) {
objConn.Open();

objCmd = new OleDbCommand("SELECT * FROM dbo.tblNewsCategories", objConn);
objRdr = objCmd.ExecuteReader();
ddlCategory.DataSource = objRdr;
ddlCategory.DataValueField = "CategoryID";
ddlCategory.DataTextField = "CategoryName";
ddlCategory.DataBind();
objRdr.Close();

objCmd = new OleDbCommand("SELECT * FROM dbo.tblSubCategories", objConn);
objRdr = objCmd.Executereader();
ddlSubCategory.DataSource = objRdr;
ddlSubCategory.DataValueField = "SubCategoryID";
ddlSubCategory.DataTextField = "SubCategoryName";
ddlSubCategory.DataBind();
objRdr.Close();

objConn.Close();
}
}


</script>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<table>
<tr>
<td align="right">Title:</td>
<td align="left"><asp:TextBox ID="txtArticleTitle" CssClass="textbox" runat="server" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtArticleTitle" ErrorMessage="*" runat="server" />
<br />
</td>

<!-- <asp:CompareValidator ID="cvArticleTitle" ControlToValidate="txtArticleTitle" Operator="DataTypeCheck" Type="String" ErrorMessage="No numbers allowed" />-->
</tr>
<tr>
<td align="right"><p>Article Category:</td><td align="left"><asp:DropDownList ID="ddlCategory" CssClass="dropdownmenu" runat="server" /></td>
</tr>
<tr>
<td align="right"><p>Article Sub Category:</td><td align="left"><asp:DropDownList ID="ddlSubCategory" runat="server" /></td>
</tr>
<tr><td align="right">News Article:</td><td align="left"><asp:TextBox ID="txtArticleDesc" CssClass="textbox" Columns="40" Rows="4" TextMode="MultiLine" runat="server" />
<asp:RequiredFieldValidator ID="rfvArticleDesc" ControlToValidate="txtArticleDesc" ErrorMessage="*" runat="server" />
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>

<asp:Button ID="btnSubmit" CssClass="button" runat="server" Text="Submit" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>

Use SQLDBConnection.
Why dont you check out the tutorials on these forums. They have good explanation with sample code too.|||thank you.

Now that I am able to query certail tables and create drop down menus i am getting an error when trying to insert my record:

Exception Details:System.Data.OleDb.OleDbException: Must declare the scalar variable "@.NewsID".

Source Error:

Line 50: objCmd.Parameters.Add("@.ArticleLink", txtArticleLink.Text);
Line 51: objConn.Open();
Line 52: objCmd.ExecuteNonQuery();
Line 53: objConn.Close();
Line 54: Response.Redirect("mynews.aspx");

HERE IS M CODE:
void SubmitNewsArticle(Object s, EventArgs e)
{
objCmd = new System.Data.OleDb.OleDbCommand(
"INSERT INTO tblNews (NewsID, ArticleDate, Title, " +
"CategoryID, SubCategoryID, ArticleDesc, ArticleLink) " +
"VALUES (@.NewsID, @.Title, @.CategoryID, " +
"@.SubCategoryID, @.ArticleDesc, @.ArticleLink)", objConn);
objCmd.Parameters.Add("@.NewsID", 1);
objCmd.Parameters.Add("@.ArticleDate", txtArticleDate.Text);
objCmd.Parameters.Add("@.Title", txtArticleTitle.Text);
objCmd.Parameters.Add("@.CategoryID",
ddlCategory.SelectedItem.Value);
objCmd.Parameters.Add("@.SubCategoryID",
ddlSubCategory.SelectedItem.Value);
objCmd.Parameters.Add("@.ArticleDesc", txtArticleDesc.Text);
objCmd.Parameters.Add("@.ArticleLink", txtArticleLink.Text);
objConn.Open();
objCmd.ExecuteNonQuery();
objConn.Close();
Response.Redirect("mynews.aspx");
}

what am I missing?? sorry for the posts :( so new to C# and .net -- I am a coldfusion web developer (1 year exp)

thanks again in advanced|||looks like you are still using OLEDB connection. What is your backend? SQL Server or Access/something else? Check ifthis articlehelps (its in VB.NET but you could get an idea of how to declare parameters and set the values).