Hi I'm still rather new and cannot write from scratch it seems. I've tried compiling types of requests etc and code I've seen however it does not work. Wish I knew how to do this stuff perfectly...
Basically, I have a stored procedure in SQL that I've done. Basically, it checks what user has query'd, if they are a valid user, the query pulls out all customer info as desired. However it does not just pull out all customer data, it pulls out only what
the person has asked for. So I have made an aspx page which has 1 textbox along with a Click/submit button. You type in the criteria that you want to search for and click submit.
The part I'm having problems with is actually making the .cs file for these 2 parts. (the messanger as such!)
I want the textbox to be the @UserData, then click "Run" to run the report which obviously puts in the @UserData into the procedure to pull up the info required. It returns the data in a table/grid view format containing 5 or 6 columns of data, could be
any amount of rows returned.
Anyone can you give me some advice so I can learn how to do this? There is no simple way of learning it. I learn by seeing how something works and picking it apart. I've nothing like this to pick apart. Ideally I need educating I know! :(
Stored Procedure
USE [FM204r]
GO
/****** Object: StoredProcedure [dbo].[sp_ModelOfInterest] Script Date: 02/26/2013 12:56:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:Daniel Bonner
-- Create date: 13/11/2012
-- Description: Procedure to pull up any prospect that has an interest in a specific car via a web application.
-- =============================================
ALTER PROCEDURE [dbo].[sp_ModelOfInterest]
@userID INT,
@sessionID VARCHAR(50),
@publictoken VARCHAR(50),
@privatetoken VARCHAR(50),
@ipaddr VARCHAR(15),
@useragent VARCHAR(255),
@ModelInterest varchar(25)
AS
SET NOCOUNT ON;
DECLARE @validID INT;
SET @validID = (SELECT lv_us_id FROM LIVE WHERE
lv_us_id = @userid
AND
lv_ipaddr = @ipaddr AND
lv_useragent = @useragent AND
lv_publictoken = @publictoken AND
lv_privatetoken = @privatetoken AND
lv_sessionid = @sessionID
);
IF @validID IS NOT NULL
BEGIN
SET NOCOUNT ON;
SELECT Top 100 [ld_idno]
,[ld_company]
,[ld_decisionmaker]
,[ld_decisionmaker_jobtitle]
,[ld_decisionmaker_workphone]
,[ld_decisionmaker_mobile]
,[ld_decisionmaker_email]
FROM [FM204r].[dbo].tblLeads
where ld_discussion_model in (SELECT po_idno FROM [FM204r].[dbo].tblPopulation
JOIN [FM204r].[dbo].tblLeads
ON ld_discussion_model = po_idno
WHERE [po_word]=@ModelInterest) AND
ld_assigned=@validID
ORDER BY ld_dtup ASC
END
ELSE
BEGIN
RETURN 0; -- enforce logout
END
So all I need to know is what to do for the C# file as I'm stuck on this now. :( I've made the below but still get an error. I think I've not told the database to look at the textbox for the @userdata, but in actual fact the clickbutton ("Run"). I need it
to look at the textbox and then the clikbutton to run the procedure.
"Sorry and Error Occurred" in black text. No info via source etc. I think it's just the .cs file I'm having real trouble with. I know SQL but I never used to have to do the web side front of things so now I'm stuck in the mud.
anybody any ideas? Still no joy today I'm afraid. I just canot create this .cs file to work. I don't think I've done it right at all... And the thing I've come to so far is a child control error on the textbox. But it's been one error after another. I overcome
one and then get another... So I know I haven't done a thing right or even if I'm using the right user controls!
All I want is a textbox, that you enter a value in, you click the run button next to it and it submits the value in the text box into the @ user data in the stored procedure. The procedure is obviously ran, and then it returns the desired data in a table
below.
CS0117: 'string' does not contain a definition for 'text'
c:\windows\system32\inetsrv> "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_2apangpo.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorlib.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_fleetmanagerglobal.master.cdcab7d2.jbisgudl.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\assembly\GAC_64\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Code.moz1gjdh.dll"
/R:"C:\Windows\assembly\GAC_64\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_global.asax.jy_-nxhf.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll"
/out:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_qkq2rkbh.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701 "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_qkq2rkbh.0.cs"
"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_qkq2rkbh.1.cs" "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_qkq2rkbh.2.cs"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.4927
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
c:\inetpub\wwwroot\ModelInterestRep.aspx.cs(25,46): error CS0117: 'string' does not contain a definition for 'Text'
c:\inetpub\wwwroot\ModelInterestRep.aspx.cs(26,35): error CS0103: The name 'Utils' does not exist in the current context
c:\inetpub\wwwroot\ModelInterestRep.aspx.cs(56,17): error CS0103: The name 'populateTable' does not exist in the current context
You are declaring a variable called modelinterest of type string and then trying to access a Text property of that string in the same statement. I think you are trying to get the Text property of a control with exactly the same name. One of these things
needs to have its name changed, either the aspx control or the string variable.
The name 'Utils' does not exist in the current context
Basically, this means "What is Utils"? Can you answer that question?
ttldbonner
0 Points
9 Posts
Creating a .cs c# file connecting to a stored procedure
Feb 26, 2013 12:06 PM|LINK
Hi I'm still rather new and cannot write from scratch it seems. I've tried compiling types of requests etc and code I've seen however it does not work. Wish I knew how to do this stuff perfectly...
Basically, I have a stored procedure in SQL that I've done. Basically, it checks what user has query'd, if they are a valid user, the query pulls out all customer info as desired. However it does not just pull out all customer data, it pulls out only what the person has asked for. So I have made an aspx page which has 1 textbox along with a Click/submit button. You type in the criteria that you want to search for and click submit.
The part I'm having problems with is actually making the .cs file for these 2 parts. (the messanger as such!)
I want the textbox to be the @UserData, then click "Run" to run the report which obviously puts in the @UserData into the procedure to pull up the info required. It returns the data in a table/grid view format containing 5 or 6 columns of data, could be any amount of rows returned.
Anyone can you give me some advice so I can learn how to do this? There is no simple way of learning it. I learn by seeing how something works and picking it apart. I've nothing like this to pick apart. Ideally I need educating I know! :(
Stored Procedure
USE [FM204r]
GO
/****** Object: StoredProcedure [dbo].[sp_ModelOfInterest] Script Date: 02/26/2013 12:56:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:Daniel Bonner
-- Create date: 13/11/2012
-- Description: Procedure to pull up any prospect that has an interest in a specific car via a web application.
-- =============================================
ALTER PROCEDURE [dbo].[sp_ModelOfInterest]
@userID INT,
@sessionID VARCHAR(50),
@publictoken VARCHAR(50),
@privatetoken VARCHAR(50),
@ipaddr VARCHAR(15),
@useragent VARCHAR(255),
@ModelInterest varchar(25)
AS
SET NOCOUNT ON;
DECLARE @validID INT;
SET @validID = (SELECT lv_us_id FROM LIVE WHERE
lv_us_id = @userid
AND
lv_ipaddr = @ipaddr AND
lv_useragent = @useragent AND
lv_publictoken = @publictoken AND
lv_privatetoken = @privatetoken AND
lv_sessionid = @sessionID
);
IF @validID IS NOT NULL
BEGIN
SET NOCOUNT ON;
SELECT Top 100 [ld_idno]
,[ld_company]
,[ld_decisionmaker]
,[ld_decisionmaker_jobtitle]
,[ld_decisionmaker_workphone]
,[ld_decisionmaker_mobile]
,[ld_decisionmaker_email]
FROM [FM204r].[dbo].tblLeads
where ld_discussion_model in (SELECT po_idno FROM [FM204r].[dbo].tblPopulation
JOIN [FM204r].[dbo].tblLeads
ON ld_discussion_model = po_idno
WHERE [po_word]=@ModelInterest) AND ld_assigned=@validID
ORDER BY ld_dtup ASC
END
ELSE
BEGIN
RETURN 0; -- enforce logout
END
modelinterest.aspx
<%@ Page Language="C#" MasterPageFile="~/FleetmanagerGlobal.master" AutoEventWireup="true" CodeFile="ModelInterestRep.aspx.cs" Inherits="_Default" %>
<%@ Register Src="Usercontrols/DropDownList.ascx" TagName="DropDownList" TagPrefix="fm" %>
<%@ Register Src="Usercontrols/TextBox.ascx" TagName="TextBox" TagPrefix="fm" %>
<%@ Register Src="Usercontrols/TextArea.ascx" TagName="TextArea" TagPrefix="fm" %>
<%@ Register Src="Usercontrols/DateBox.ascx" TagName="DateBox" TagPrefix="fm" %>
<%@ Register Src="Usercontrols/Label.ascx" TagName="Label" TagPrefix="fm" %>
<%@ Register Src="Usercontrols/NumberBox.ascx" TagName="NumberBox" TagPrefix="fm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderGlobal" Runat="Server">
<formID="form1" runat="server">
<div id="page-container" class="group">
<div id="tab-panel">
<ul class="tabs">
<li><a href="Prospects.aspx"><fm:Label ID="Label1" Text="Prospects" runat="server" /></a></li>
<li><a href="Customers.aspx"><fm:Label ID="Label2" Text="Customers" runat="server" /></a></li>
<li><a href="Review.aspx"><fm:Label ID="Label3" Text="Review" runat="server" /></a></li>
<li><a href="JobAdmin.aspx"><fm:Label ID="Label4" Text="Job Admin" runat="server" /></a></li>
<li><a href="Charts.aspx"><fm:Label ID="Label5" Text="Reports" runat="server" /></a></li>
<li><a href="DealerActivities.aspx"><fm:Label ID="Label6" Text="Activities" runat="server" /></a></li>
<li class="active"><a href="ModelInterestRep.aspx"><fm:Label ID="Label7" Text="Model Enquiry" runat="server" /></a></li>
</ul>
<div id="tab-container">
<div id="layout1" class="tab-content">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="two-col">
<tr>
<th><fm:Label ID="Label9" runat="server" Text="Model of Interest" /></th>
<th><fm:Label ID="Label8" runat="server" Text="" /></th>
</tr>
<tr>
<td>
<ol>
<li></li>
<li></li>
<li><fm:TextBox ID="modelinterest" runat="server" Text="Model of Interest Enquired" /></li>
</OL>
</td>
<td>
<ol>
<li><asp:LinkButton ID="LinkButton1_Click" runat="server" OnClick="LinkButton1_Click" CssClass="blue popup-button" ><fm:Label ID="Label10" Text="Run" runat="server" /></asp:LinkButton></li>
</OL>
</td>
</tr>
</table>
<table>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<ItemTemplate>
<tr class="datarow">
<td>
<asp:Label ID="Company" runat="server" />
</td>
<td>
<asp:Label ID="DM" runat="server" />
</td>
<td>
<asp:Label ID="DM_Job" runat="server" />
</td>
<td>
<asp:Label ID="DM_Work_No" runat="server" />
</td>
<td>
<asp:Label ID="DM_Mob" runat="server" />
</td>
<td>
<asp:Label ID="DM_Email" runat="server" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
</div>
</formID>
</div>
</div>
</asp:Content>
So all I need to know is what to do for the C# file as I'm stuck on this now. :( I've made the below but still get an error. I think I've not told the database to look at the textbox for the @userdata, but in actual fact the clickbutton ("Run"). I need it to look at the textbox and then the clikbutton to run the procedure.
using
System;
using
System.Data;
using
System.Configuration;
using
System.Collections;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
System.Data.SqlClient;
public
partial class _Default: System.Web.UI.Page
{
protected void page_load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
protected void LinkButtonMod_Click(object sender, EventArgs e)
{
string modelinterest = modelinterest.Text("modelinterest");
string connectionString = Utils.GetConnString();
using (SqlConnection conn = new SqlConnection(connectionString))
{
using (SqlCommand cmd = new SqlCommand("sp_modelofinterest", conn))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(
"@modelinterest", modelinterest);
cmd.Parameters.Add(
"@userid", SqlDbType.Int).Value = Fleetmanager.UserID;
cmd.Parameters.Add(
"@privateToken", SqlDbType.VarChar, 50).Value = Fleetmanager.PrivateToken;
cmd.Parameters.Add(
"@publicToken", SqlDbType.VarChar, 50).Value = Request.QueryString["token"].ToString();
cmd.Parameters.Add(
"@sessionID", SqlDbType.VarChar, 50).Value = Fleetmanager.SessionID;
cmd.Parameters.Add(
"@ipaddr", SqlDbType.VarChar, 15).Value = Fleetmanager.IPaddr;
cmd.Parameters.Add(
"@useragent", SqlDbType.VarChar, 255).Value = Fleetmanager.UserAgent;
SqlParameter param = cmd.Parameters.Add(
"@RETURN_VALUE", SqlDbType.Int);
param.Direction = ParameterDirection.ReturnValue;
conn.Open();
cmd.ExecuteNonQuery();
int returnedUser = Convert.ToInt32(param.Value);
if (returnedUser == 0)
{
Response.Redirect(
"Logout.aspx");
}
populateTable();
}
}
}
protected void RepeaterMod_ItemDataBound(Object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Label Company = (Label)e.Item.FindControl(
"Company");
Label DM = (Label)e.Item.FindControl(
"Decision Maker");
Label DM_Job = (Label)e.Item.FindControl(
"Job Title");
Label DM_Work_No = (Label)e.Item.FindControl(
"Phone Number");
Label DM_Mob = (Label)e.Item.FindControl(
"Mobile Number");
Label DM_Email = (Label)e.Item.FindControl(
"Email Address");
DataRowView drv = e.Item.DataItem
as DataRowView;
try
{
Company.Text = drv.Row[
"ld_company"].ToString().Substring(0, 10);
DM.Text = drv.Row[
"ld_decisionmaker"].ToString().Substring(0, 10);
DM_Job.Text = drv.Row[
"ld_decisionmaker_jobtitle"].ToString().Substring(0, 10);
DM_Work_No.Text = drv.Row[
"ld_decisionmaker_workphone"].ToString().Substring(0, 10);
DM_Mob.Text = drv.Row[
"ld_decisionmaker_mobile"].ToString().Substring(0, 10);
DM_Email.Text = drv.Row[
"ld_decisionmaker_email"].ToString().Substring(0, 10);
}
catch { }
}
}
}
Thanks,
Dan
asp.net, SQL, Stored Procedure, SPROCS, ASPX, ASP, C#
ttldbonner
0 Points
9 Posts
Re: Creating a .cs c# file connecting to a stored procedure
Feb 26, 2013 02:17 PM|LINK
Anybody any ideas? :(
I'm stuck good and proper
WishStar99
Contributor
2857 Points
879 Posts
Re: Creating a .cs c# file connecting to a stored procedure
Feb 26, 2013 04:02 PM|LINK
what's the error do you get?
ttldbonner
0 Points
9 Posts
Re: Creating a .cs c# file connecting to a stored procedure
Feb 26, 2013 04:04 PM|LINK
Literally just
"Sorry and Error Occurred" in black text. No info via source etc. I think it's just the .cs file I'm having real trouble with. I know SQL but I never used to have to do the web side front of things so now I'm stuck in the mud.
ttldbonner
0 Points
9 Posts
Re: Creating a .cs c# file connecting to a stored procedure
Feb 27, 2013 04:30 PM|LINK
anybody any ideas? Still no joy today I'm afraid. I just canot create this .cs file to work. I don't think I've done it right at all... And the thing I've come to so far is a child control error on the textbox. But it's been one error after another. I overcome one and then get another... So I know I haven't done a thing right or even if I'm using the right user controls!
All I want is a textbox, that you enter a value in, you click the run button next to it and it submits the value in the text box into the @ user data in the stored procedure. The procedure is obviously ran, and then it returns the desired data in a table below.
ttldbonner
0 Points
9 Posts
Re: Creating a .cs c# file connecting to a stored procedure
Feb 28, 2013 04:21 PM|LINK
I get this error now...
CS0117: 'string' does not contain a definition for 'text'
c:\windows\system32\inetsrv> "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_2apangpo.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorlib.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_fleetmanagerglobal.master.cdcab7d2.jbisgudl.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\assembly\GAC_64\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Code.moz1gjdh.dll" /R:"C:\Windows\assembly\GAC_64\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_global.asax.jy_-nxhf.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /out:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_qkq2rkbh.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701 "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_qkq2rkbh.0.cs" "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_qkq2rkbh.1.cs" "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_qkq2rkbh.2.cs"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.4927
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
c:\inetpub\wwwroot\ModelInterestRep.aspx.cs(25,46): error CS0117: 'string' does not contain a definition for 'Text'
c:\inetpub\wwwroot\ModelInterestRep.aspx.cs(26,35): error CS0103: The name 'Utils' does not exist in the current context
c:\inetpub\wwwroot\ModelInterestRep.aspx.cs(56,17): error CS0103: The name 'populateTable' does not exist in the current context
Help!
Paul Linton
Star
13571 Points
2571 Posts
Re: Creating a .cs c# file connecting to a stored procedure
Mar 01, 2013 01:18 AM|LINK
You have a line of code
string modelinterest = modelinterest.Text("modelinterest");
You are declaring a variable called modelinterest of type string and then trying to access a Text property of that string in the same statement. I think you are trying to get the Text property of a control with exactly the same name. One of these things needs to have its name changed, either the aspx control or the string variable.
The name 'Utils' does not exist in the current context
Basically, this means "What is Utils"? Can you answer that question?
Same for 'populateTable'