|
I have a database in sql server named as "stock" in which "custdetails" is a table which has various fields.
I have connection string as-
ConString = "Data Source=localhost;Initial Catalog=stock;Integrated Security=true";
and two method selecct and update as-
public DataTable select(String query)
{
DataSet ds = new DataSet();
SqlDataAdapter adp = new SqlDataAdapter(query, ConString);
adp.Fill(ds);
return (ds.Tables[0]);
}
public void update(String query)
{
DataSet ds = new DataSet();
SqlDataAdapter adp = new SqlDataAdapter(query, ConString);
adp.Fill(ds);
Now I have a button.when buton is clicked i want to take data from database.But it is not retrieved. I have cheked it by printing it in a textbox.the code is as follow-
DataTable dt=new DataTable();
common obj=new common();
dt = obj.select("select * from custdetails");
TextBox2.Text = dt.Rows.Count.ToString();
TextBox1.Text = dt.Rows[1][1].ToString();
It is not working.what problem can be????
plz help me.......
|
|
|
|
|
jainiraj wrote: But it is not retrieved
How did it fail? What exception did you get?
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
First of all what does it has do with ASP.Net?
What have you done to even think that it is going to retrieve data from the database.
I dont see any piece of code which is actually interacting with the database?
jainiraj wrote: common obj=new common();
what does it do?
Have a look here[^].
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
use select query like this
string select = "select * from custdetails"
SqlDataAdapter da = new SqlDataAdapter(select.ToString(), con);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
Padmanabhan
|
|
|
|
|
And this helps him how?
Missing ;, pointless ToString() call on a string instance and an undeclared variable conn. His code was fine, bar the naming convention. The most likely problem he has is a connection issue.
I'm just really curious as to what your mindset was in posting this?
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
ConString = "Data Source=localhost;Initial Catalog=stock;Integrated Security=true";
string select = "select * from custdetails";
SqlDataAdapter da = new SqlDataAdapter(select, ConString);
DataTable dt = new DataTable();
da.Fill(dt);
//here comes ur code
TextBox2.Text = dt.Rows.Count.ToString();
TextBox1.Text = dt.Rows[1][1].ToString();
//now it will work fine
Padmanabhan
|
|
|
|
|
I have a custom File management ASP application that handles Large File uploads and download from a database (30 - 40 MB files) The application works fine on IIS5 but when I relocate it to IIS6 i get an error when I file not found error when i attempt to download out of the Database. IS there a reg setting or metabase setting that i need to change to handle large blob outputs.? Sorry I can't be more specific about the error msg but that is all it give's me a File not found error. it does however work fine with small files less then 2mb in size
When i checked for help i found this:http://support.microsoft.com/default.aspx?scid=KB;EN-US;q316431&[^]
And this is the error i get
Error message 1
Internet Explorer cannot download file from server.
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
I was using IIS 5.0 and win 2000 before. Now i have migrated to IIS6.0 and Win2003
Any help on this will be highly appreciated.
Biju Sam
|
|
|
|
|
I have a web service which I want only the people with a certain digital certicate only be allowed to access it. My question is do I secure the web service itself or is it some setting from the IIS?
|
|
|
|
|
I am using an OracleDataAdapter to fill a dataset where i have a column with datatype float in database. So after i do the .fill into dataset and try to view the contents of the dataset in debug mode. for that column if a row has value 3500 and the row following that also has 3500 the second 3500 has blank value. How to fix this?
|
|
|
|
|
Civic06 wrote: DataGrid to Excel
What does it has to do with excel?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
At first i thought it had to with excel. but it doesn't after i debugged.
|
|
|
|
|
Hi,
I have several dropdown controls and input controls(let us say 10 controls)in a single td tag inside the table. Horizontal scroll is required to see all the controls. But when resize the the IE(i.e. make smaller the IE) how can I make the controls wrapdown?
any CSS can be used? I know with div tag it can be wrap down.But i wanted to keep it in a table itself?
any idea please?
|
|
|
|
|
we can baidu,google,sohu,yoohu.com or so much!
|
|
|
|
|
Hi,
I wanted to create a user control to be used across multiple web applications under one solution.
How can I create it using a web control library.
In short how to work with a web control library and add those controls in your project.
I can create a .ascx file in each project and do it but I do not want that. I want only one file which I can reuse in each application without adding any code.
Rgds,
Rains
|
|
|
|
|
Like this[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
This is the normal way of creating the user control.
I want to know how to create using web control library.
rgds,
Rains
|
|
|
|
|
Hi all.
How are you?
Can anyone tell me what is the best way to view the user comment as in forum?
Thanks a lot...
|
|
|
|
|
|
Hi!!
I'm using SQL Server 2005.
and I've a table of comments.
so I want to view thease comments in the page. (Like forums)
|
|
|
|
|
|
|
Feddo04 wrote: Hi all.
How are you?
I`m fine!!! Thank You!!!
Feddo04 wrote: Can anyone tell me what is the best way to view the user comment as in forum?
Use a good browser. You can find one here[^]
Feddo04 wrote: Thanks a lot...
You are welcomed !!!
When you fail to plan, you are planning to fail.
|
|
|
|
|
I have connection sting like-
connectionString="Data Source=IpAddress,Port#;Initial Catalog=DatabaseName;uid=user;pwd=password;" providerName="System.Data.SqlClient";
here what is meaning of "Data Source=IpAddress,Port#"...
plz explain........
|
|
|
|
|
in Data Source you write the server where the database is.
If the database is in your local machine then you write: DataSource="Local" (or the name of you pc).
|
|
|
|
|
Check this,ConnectionStrings[^]
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|