|
hi murugavel
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
DataSet ds1 = new DataSet();
using (SqlConnection sqlcon = new SqlConnection("Data Source=localhost;Initial Catalog=master;integrated security=true"))
{
sqlcon.Open();
string sQuery = "exec sp_databases1";
SqlCommand cmd = new SqlCommand(sQuery, sqlcon);
SqlDataAdapter objSqlDA = new SqlDataAdapter(cmd);
objSqlDA.Fill(ds1);
DropDownList2.DataSource = ds1;
DropDownList2.DataTextField = "Database_Value1";
DropDownList2.DataValueField = "Database_ID1";
DropDownList2.DataBind();
}
}
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
DataSet ds2 = new DataSet();
using (SqlConnection sqlcon = new SqlConnection("Data Source=localhost;Initial Catalog=master;integrated security=true"))
{
sqlcon.Open();
string sQuery = "exec sp_databases2";
SqlCommand cmd = new SqlCommand(sQuery, sqlcon);
SqlDataAdapter objSqlDA = new SqlDataAdapter(cmd);
objSqlDA.Fill(ds2);
DropDownList3.DataSource = ds2;
DropDownList3.DataTextField = "Database_Value2";
DropDownList3.DataValueField = "Database_ID2";
DropDownList3.DataBind();
}
}
-sathis-
|
|
|
|
|
Hi,
I think u didnt understand my question.
for example.
in dropdownlist1 -- i select the northwinddatabase.
in dropdownlist2 -- list the table names depend on dropdownlist1
in dropdownlist3 -- list the columns contains in the table depend on dropdownlist2
Thanks,
Murugavel
|
|
|
|
|
Murugavel Sadagopan wrote:
Hi,
i have three dropdown boxes, in first drop down boxes i have a items of databases name.
i want 2nd drop down box contains list of tables dependent on dropdown box1 of databasename.
please guide me,
Where you are mentioned following,In the above question
Murugavel Sadagopan wrote: in dropdownlist3 -- list the columns contains in the table depend on dropdownlist2
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
modified on Tuesday, July 8, 2008 3:05 AM
|
|
|
|
|
I would create a class that accepts SqlParameter[] (Array).
Than you add the SqlParameter[] as addRange to the SqlConnection
Small Example?
SqlParameter[] parms = new SqlParameter[1];
parms[0] = new SqlParameter("@databaseID", dropDownList1.SelectedValue);
ddlDropDownlist2 = MyClass.FillMyDropDownList(ddlDropDownlist2, parms, "ddlText", "ddlID", "ConnectionString", "SqlCommandOrStoredProcedure");
public DropDownList FillMyDropDown(DropDownList ddlName, SqlParameter[] parms, String TextValue, String IDValue, String ConnectionName, String StoredProcedure)
{
SqlCommand cmd = null;
cmd = BaseDatabaseData(StoredProcedure, parms, ConnectionName);
ddlName.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection);
ddlName.DataTextField = TextValue;
ddlName.DataValueField = IDValue;
ddlName.DataBind()
cmd.Connection.Close();
return ddlName;
}
private SqlCommand BaseDatabaseData(String StoredProc, SqlParameter[] arrParameters, String ConnectionName)
{
try
{
String connection = System.Configuration.ConfigurationManager.ConnectionStrings[ConnectionName].ConnectionString;
SqlConnection con = new SqlConnection(connection);
SqlCommand cmd = new SqlCommand(StoredProc, con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddRange(arrParameters);
cmd.CommandTimeout = 3600;
cmd.UpdatedRowSource = UpdateRowSource.None;
if (cmd.Connection.State.Equals(ConnectionState.Open))
cmd.Connection.Close();
cmd.Connection.Open();
return cmd;
}
catch (Exception err)
{
throw new Exception(err.Message, err.InnerException);
}
}
|
|
|
|
|
can anyone help me with this...any samples in vb would be great
i have already searched google and had no luck.
thanks
|
|
|
|
|
I am developing a web application using ASP.NET 2.0. I want to view/modify file metadata like Author, Title, Company, etc. that file may be a txt / doc / exe / xml / html / pdf/ doc any format...
File metadata can be viewed / modified using dsofile.dll, but it is applied only on Office documents.
How can I view/modify file metadata that can applied on all files( txt / doc / exe / xml / html / pdf).
|
|
|
|
|
Hi,
I've made a Web Crawler in C#.Net and it crawls a given url in the textbox for all the url's on the page and stores in database.
Then taking one url at a time it again crawls all the urls for email addresses on the contact page of the website.
Now what i want is that when i open my web browser and open google.com search for anything and the results which come out, i mean it gives all the links n urls so i want my tool to work there.
I want my web crawler to work with the google.com results... right now i'm manually providing one url in the textbox for the whole crawling procedures.
I hope i can get good advice and suggestion to solve my problem.
Thanks
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
hi,
can't your web crawler start off by accessing the Google page?
send a WebRequest containing Google's URL plus all relevant search parameters, and
capture the response.
If that's OK with you, you don't need a browser at all.
If not, include a WebBrowser object in your app, use it to Google, and take the Document
it produces as the starting point.
|
|
|
|
|
It can start off by accessing the google page but it is manual thing.
everytime i've to put the url in the textbox. i want it to be done with a single click. I mean i want my web crawler to automatically check the google page for the search done by any user.
Hope you are getting me??
I'll explain it again. For example: firstly a user opens a web browser and searches for "new medicine invented" google will search for the given keyword and displays the links n urls now here my crawler should work with a single click it should do all the task..
Now hope you get my view. So please if you have any suggestion regarding this one do reply
Thanks
Paritosh Tripathi
B.Tech. (C.S.)
modified on Tuesday, July 8, 2008 3:55 AM
|
|
|
|
|
Hi,
IMO you can achieve this with the WebBrowser control, have a look at the Navigaring event.
|
|
|
|
|
Hi Guys, I am wondering is it possible to have a button to prompt the "Save Page As" command that IE/Firefox has under file ?
|
|
|
|
|
to make the buton is easy. To make it functional you have problem of denying the self created button in the page. (you want to safe the page without the button I Guess?)
|
|
|
|
|
Hi thanks for the reply, i am not sure what you meant but when saving it does not matter if the button is visible or not.
|
|
|
|
|
I just deployed a c# web service from my notebook to my server. Worked fine locally but puked under IIS.
Error Message: "That assembly does not support partially trusted callers".
What I have is a web service assembly (strong name) that references my data access layer assembly (strong name). It seems that the DAL assembly is expecting full trust and the web service is partial trust. If I comment out creating the DAL object, the web service runs fine.
Anyone know what I need to do to change the trust levels either on IIS, on the web service, assembly or otherwise? I'm on 3.0/3.5
Thanks!
|
|
|
|
|
I just had to think it through a bit more. If anyone's interested, you just change the trust level for the web service:
In the web.config -
<SecurityPolicy>
<trustLevel name="Full" policyFile="internal" />
</SecurityPolicy>
<trust level="Full" originUrl="" processRequestInApplicationTrust="true"/>
|
|
|
|
|
Hi,
In Visual studio 2005, i have a drop down list. i want to add list of databases in dropdown list.
i try the below mentioned code. But it returns System.Data.DataRowView in dropdown list not the database name.
I also ensure in SQL Server execute the command "exec sp_databases" it returns 16 Databases names and autopostback property is also true.
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
using (SqlConnection sqlcon = new SqlConnection("Data Source=localhost;Initial Catalog=master;integrated security=true"))
{
sqlcon.Open();
string sQuery = "exec sp_databases";
SqlCommand cmd = new SqlCommand(sQuery, sqlcon);
SqlDataAdapter objSqlDA = new SqlDataAdapter(cmd);
objSqlDA.Fill(ds);
DropDownList1.DataSource = ds;
DropDownList1.DataBind();
}
Thanks,
Murugavel
|
|
|
|
|
hi
U didn't bind the DataTextField and DataValueField of the Dropdownlist.
Bind the DataTextField with Database Name and DatavalueField with DatabaseID.
Hope this will help u
Regards
Avesh Agarwal
|
|
|
|
|
i am trying to begin my venture
will do my own software bussiness
someone knows about advertising by cellular SMS
some company of your country that work in this sector
some site with ideas
thansk for the time
regards
|
|
|
|
|
You'll probably need to work on the English a bit.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
What does this have to do with ASP.NET ?
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Hi,
I will be going for a short vacation, and it is actually quite possible that there will be nothing to do there except programming! Hopefully this will not be the case. However, there is no internet connection there. I was thinking about starting with ASP.NET MVC and start my first MVC project, so the question is: what resources should I pre-download and store on my laptop? I'm aware of Scott Guthrie's blog entries, and will save them, any other comments?
Regards,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
|
protected void uploade_Click(object sender, EventArgs e)
{
if (uploadetest.HasFile == false)
{
uploadedetail.Text = "plese select youre file";
}
else
string filepath=Server.MapPath("~/pic/" + UploadeTest.FileName);
UploadeTest.SaveAs(filepath);
}
I use these code for uploading but it has an error.I dont know what should I do.
error:(CS1023: Embedded statement cannot be a declaration or labeled statement)
|
|
|
|
|
Wow - even your code is full of typos.
1 - you should answer me in the thread I was helping you on, not starta new one.
2 - your error relates to your aspx, not your code behind. Post the aspx code pls.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
bbc_sh wrote: else
string filepath=Server.MapPath("~/pic/" + UploadeTest.FileName);
UploadeTest.SaveAs(filepath);
<br />
else<br />
{<br />
string filepath=Server.MapPath("~/pic/" + UploadeTest.FileName);<br />
UploadeTest.SaveAs(filepath);<br />
}<br />
OR
<br />
protected void uploade_Click(object sender, EventArgs e)<br />
{<br />
string filepath;<br />
if (UploadeTest.HasFile == false)<br />
{<br />
uploadedetail.Text = "plese select youre file";<br />
}<br />
else<br />
filepath=Server.MapPath("~/pic/" + UploadeTest.FileName);<br />
UploadeTest.SaveAs(filepath);<br />
}<br />
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
modified on Tuesday, July 8, 2008 2:26 AM
|
|
|
|