1,105,447 Community Members

error Keyword not supported: 'data base'.

Member Avatar
Wael1988
Newbie Poster
21 posts since Dec 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hello
i am trying to insert data to Data base using Stored Proc , while i replace my Connection string in the web.config file
after i run my app , and inserting my data..
it says

Keyword not supported: 'data base'.

Member Avatar
Wael1988
Newbie Poster
21 posts since Dec 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i am trying to attach a screen shoot but i cnt find any tool here to attach with !! ;s

Member Avatar
pritaeas
mod_pritaeas
11,317 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 

Use the paperclip in the toolbar.

data base should probably be database

Member Avatar
Wael1988
Newbie Poster
21 posts since Dec 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

when i edited data base to database.. it ddnt work .
it says

Sunday, December 29, 2013 12:43 AM <dir> bin
Wednesday, January 01, 2014 11:57 AM 3,894 ContactUs.aspx
Wednesday, January 01, 2014 12:23 PM 1,902 ContactUs.aspx.cs
Wednesday, January 01, 2014 11:57 AM 5,658 ContactUs.aspx.designer.cs
Sunday, December 29, 2013 12:43 AM 4,256 ContactUs.csproj
Sunday, December 29, 2013 12:43 AM 1,086 ContactUs.csproj.user
Sunday, December 29, 2013 12:04 AM <dir> obj
Sunday, December 29, 2013 12:04 AM <dir> Properties
Wednesday, January 01, 2014 04:11 PM 547 Web.config
Sunday, December 29, 2013 12:04 AM 1,285 Web.Debug.config
Sunday, December 29, 2013 12:04 AM 1,346 Web.Release.config

where is that paper clip ?

Member Avatar
deceptikon
Eternally Awesome
4,695 posts since Jan 2012
Reputation Points: 1,341 [?]
Q&As Helped to Solve: 689 [?]
Skill Endorsements: 104 [?]
Administrator
Featured
 
0
 

Please post your web.config file. Feel free to censor user names, server names, and passwords. It looks like the connection string is malformed for the information you've already provided.

Member Avatar
Wael1988
Newbie Poster
21 posts since Dec 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

here you are a compy of my web.config file

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <connectionStrings>
    <add
      name="myConnectionString" 
      connectionString=" Data Source=. ; Data Base = ContactUsDB ; Integrated Security = true"
      providerName="System.Data.SqlClient"></add>

  </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0" ></compilation>
    </system.web>

</configuration>

and this is my code

 protected void Button1_Click(object sender, EventArgs e)
        {



        string conString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
        SqlConnection con = new SqlConnection(conString);
        SqlCommand Cmd = new SqlCommand();
        Cmd.CommandType = CommandType.StoredProcedure;
        Cmd.CommandText = "Sp_ContactUs_Insert";


        Cmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = TxtName.Text.Trim();
        Cmd.Parameters.Add("@Email", SqlDbType.VarChar).Value = TxtEmail.Text.Trim();
        Cmd.Parameters.Add("@Phone", SqlDbType.VarChar).Value = TxtPhone.Text.Trim();
        Cmd.Parameters.Add("@MailSubject", SqlDbType.VarChar).Value = TxtSubject.Text.Trim();
        Cmd.Parameters.Add("@Body", SqlDbType.VarChar).Value = TxtBody.Text.Trim();
        try
        {
        Cmd.Connection = con;

            con.Open();
            if (Cmd.ExecuteNonQuery() > 0)
            {
                Label1.Text = " Your Message Has been Sent , Thank you";
            }
            else
            {
                Label1.Text = " There is an error... please try again later";
            }
        }

        finally
        {
            con.Close();
            con.Dispose();

        }
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article