|
Hi,
Thank you for replying. Actually there is a table named "STATIC" from which the home page data is coming. Does the problem is with the name "STATIC".
As I said that earlier it was working fine except the one page I added. On that page the data was coming from the table named "STATIC" and the column name was "Career". That time the error on that page was similar to the present error except the heading "Invalid column name "Career"" instead of "Invalid object name "STATIC""
cheers,
sneha
|
|
|
|
|
Well, that seems to clear up the mystery. Either it's an invalid name, or you're somehow failing to scope it properly.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
sneha Choudhary wrote: I googled and found that I should set up the database again.
I am really curious to know what did you googled.
Show some code how you are trying to access the table. That would help.
|
|
|
|
|
d@nish wrote: Show some code how you are trying to access the table. That would help.
I changed the table name "STATIC" to "STATICDATA" and the code is:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
BenefitsData();
WelcomeData();
list_of_courses();
Latest_News();
}
}
public void WelcomeData()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newcon"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select Welcome from dbo.STATICDATA";
cmd.Connection.Open();
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
string welcome_text = rdr["welcome"].ToString();
LblWelcomeText.Text = welcome_text;
}
cmd.Connection.Close();
}
public void BenefitsData()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newcon"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select Benefits from dbo.STATICDATA";
cmd.Connection.Open();
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
string benefits_text = rdr["Benefits"].ToString();
LblBenefits.Text = benefits_text;
}
cmd.Connection.Close();
}
public void Latest_News()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newcon"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select top 1 headline,submit_time from dbo.NEWS order by submit_time desc";
cmd.Connection.Open();
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
string head = rdr["headline"].ToString();
LblMainHeadline.Text = head;
string dat = rdr["submit_time"].ToString();
LblDate.Text = dat;
}
cmd.Connection.Close();
}
public void list_of_courses()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newcon"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select course_name,pdf_file from dbo.COURSES";
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
con.Open();
sda.Fill(dt);
DataView dview = dt.DefaultView;
DataCourses.DataSource = dview;
DataCourses.DataBind();
con.Close();
}
}
cheers,
sneha
|
|
|
|
|
Have you ever thought about structuring your code ? For example, having a data layer, and perhaps even a shared connection ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
1. Check whether the table exists in the database which is pointed by the connection string 'newcon'.
2. If table exists, check whether the table is created with the schema dbo. i.e., your table name must be created by dbo.STATICDATA. Because you are selecting records using syntax schemaname.TABLENAME. If the table is created with different schema, then you will get this error.
|
|
|
|
|
Can you show us in your code where you use the Word Static ? Try to pout a break point on that page and show us where you get an error
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi to all,
Thank you all of you for replying me and giving me the way, how to code in a better way.
My problem is solved. Found two mistakes in my code.
1. There was no closing semi bracket in one of the page. But it didn't gave any error on localhost. I don't know why.
2.There was a lot of commented code on the pages. I removed all of that.And I coded by giving a shared connection and used regions in my code. I don't know it could be a reason or not.
Then I again published and uploaded. And it worked.
Thank you for guiding me on the path of being good developer.
cheers,
sneha
|
|
|
|
|
Error: Client doesn't support authentication Protocol...
from
India Real Estate| Website Development
|
|
|
|
|
Is there a question here ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
estatekhoj wrote: Error: Client doesn't support authentication Protocol...
What is that ? What is you question?
|
|
|
|
|
his issue is he can't read, so he keeps asking until someone reads his mind.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
can anybody help me about this subject?plz
|
|
|
|
|
|
Hello Friend,
actually i am developing a Intranet application.i want to get all system of Hardware configuration & software details using WMI through Client Ip address. actually i got all Ip Address of system through Ping.and i want to know Hardware Configuration of system & Installed Software Details according to IP Address.
Thanks & Regards
raushan
|
|
|
|
|
This is not really an ASP.NET question. ASP.NET could not do this, this will only work because you're on an intranet and can do it through your network, in theory.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Ye, you r right, then how i will get Hardware & Software Details through network. Because i have need only in my organization network.
Please give some idea to do in Intranet....
Thanks & Regards
raushan
|
|
|
|
|
I'm suggesting this is the wrong forum, and you should ask in the C# forum. I don't actually know the answer, I'm telling you the best place to find it.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi,
I have html textbox and html listbox. If i type a letter in textbox corresponding names are populated to listbox.
After that i need to set the focus to my listbox when i press downarrow.
I am trying to implement this using onkeyup event by writing the follwing code:
if(key == 40)
{
//document.getElementById("ddlForResult").options(0).focus();
document.getElementById("ddlForResult").options[0].selected = true;
// var myControl = document.getElementById("ddlForResult");
// myControl.focus();
// myControl.select();
//document.getElementById("ddlForResult").selectedIndex = 0;
}
But the focus is not set into first element of listbox.
I dont know where i did a mistake, If anybody knows the solution for this please let me know....
|
|
|
|
|
dayakar_dn wrote: ddlForResult
Is this the client side name for the control ? If it's a server control, then use the ClientID property to get the client side id.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
In my page, I have a wizard control. Inside a Wizard control, there is only one textbox which checks for an unique document number. When the user types a document number in the textbox, I am checking whether it already exists in the database. if exists, I want to show a warning saying that this will be a revision of existing document.
User can either accept or reject this. How can I do this confirmation on the click on Next button of Wizard Control? I don't want to use a javascript for this. Is there any other way which i can achieve this? Please help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
meeram395 wrote: I don't want to use a javascript for this
Well, you have no choice, unless you want to do a page refresh, to show a new page that asks the user to confirm, then posts back to load whatever page was requested.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Thanks Christian.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
I am creating Tree view from database.....but its returning only one Parent Node and one Child nodee.......why......this is my code:-
Dim db As Database = DatabaseFactory.CreateDatabase("See2Buy")
Dim cmd As String = "Select Cat.CategoryID, Cat.CategoryName,SubCat1.SubCat1ID,SubCat1.SubCategoryName From Cat INNER JOIN SubCat1 ON Cat.CategoryID=SubCat1.CategoryID ORDER BY Cat.CategoryID"
Dim rdr As IDataReader = db.ExecuteReader(CommandType.Text, cmd)
While rdr.Read
Dim cat As New TreeNode
cat.Text = rdr("CategoryName").ToString()
cat.Value = rdr("CategoryID").ToString()
TreeView1.Nodes.Add(cat)
TreeView1.Nodes.Add(cat)
While rdr.Read
Dim cat1 As New TreeNode
cat1.Text = rdr("SubCategoryName").ToString()
cat1.Value = rdr("SubCat1ID").ToString()
cat.ChildNodes.Add(cat1)
End While
End While
|
|
|
|
|
your SQL looks to me like it will always return one child for each parent.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|