|
Better buy a book and start reading it and try to implement the concept.
here there are some of the links related to the Master pages.
Msdn[^]
CP[^]
4 Guys[^]
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Depends which version of framework are you using. If using 1.1 I would suggest not to bang your head too much. If 2.0+, Master is included in the Framework itself.
|
|
|
|
|
in my windows form,for search,two combo boxes are provided.the first one gives the table names and in second combo box the respective fields are provided ,by selecting any field the user enters the required value according to which te search is done
i m storing both tablename and field name in string
now in my select statement when i append the string with field name (with hard coded table name); it functions well but when i concatenate string having table name it gives errors..
$h@ma!|@
|
|
|
|
|
say me your error to check it.
We Can Do Anything, If We Want It
|
|
|
|
|
if(combobox2.text==" teachers name")
str="t_name"; //giving field name
//many if statements here
strQuery = " SELECT * FROM tbl1,tbl2,tbl3 WHERE tbl1." + str + "=" + textBox1.Text+"AND
tbl1.t_id=tbl2.tb_id AND tbl.t_id=tbl3.tb3_id ";
it works
but when i do
//tablename=combobox1.text;
//or
tablename="tbl1";
strQuery = " SELECT * FROM tbl1,tbl2,tbl3 WHERE" + tablename + "." + str + "=" +
textBox1.Text+"AND tbl1.t_id=tbl2.tb_id AND tbl.t_id=tbl3.tb3_id ";
it gives error
$h@ma!|@
|
|
|
|
|
what error?
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
some exception is handled at runtime
$h@ma!|@
|
|
|
|
|
use try catch and catch the exxception
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
strQuery = " SELECT * FROM tbl1,tbl2,tbl3 WHERE" + tablename + "." + str + "=" +<br />
<br />
&textBox1.Text+"AND tbl1.t_id=tbl2.tb_id AND tbl.t_id=tbl3.tb3_id ";
"AND" operator will be join with Textbox1.Text
so give spance there
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
strQuery = " SELECT * FROM tbl1,tbl2,tbl3 WHERE " + tablename + "." + str + "=" +
textBox1.Text+" AND tbl1.t_id=tbl2.tb_id AND tbl.t_id=tbl3.tb3_id ";
User this string
best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
still no progress!!
$h@ma!|@
|
|
|
|
|
check this also "tbl.t_id=tbl3.tb3_id"
What is tbl?
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
well tbl is the tablename in databases..actually these are not the actual tablenames but it was to simplify the query to post
$h@ma!|@
|
|
|
|
|
I've always found using string.format rather than concatentation helps to simplify things like this and makes the code more readable so you can find syntax errors better.
Of course using a stored proc, as you should, this is not an issue.
only two letters away from being an asset
|
|
|
|
|
anybody would like to help me on how to add a datetimepicker in an asp.net application...
thank you
start a new beginning in every ending; thats what life for......
|
|
|
|
|
Get it[^]
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Hi everyone,
My problem is that I have a gridview, which has an objetdatasource as it´s datasource. The objectdatasource is filled with a method that retrieves a datatable. All this is just fine, but when I try to update my gridview, I need to write a method for the objectdatasource to update the datatable, but I can´t find a way to pass the updated field as a parameter to this method. Is there an specific way of doing this??? or is there a better way to do what I need??? I am not using "directly" a table from the database because I need to do some operations with the data first. I would rally appreciate any answer on this, my work depends on this!!!! Thanks in advance
|
|
|
|
|
|
Hi Guru's
I know this sound elementary but here goes, how can I get the cell value on a datagrid?
By the way Im using asp:TemplateColumn instead of BoundColumn e.item.cells(3).text does return the cell value when on BoundColumn mode but not in asp:TemplateColumn
Dom
-- modified at 23:11 Wednesday 11th July, 2007
|
|
|
|
|
Take Label in Template Column
U can get value By ((Label)e.Item[index].FindControl("lblid")).Text
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Hi I tried to use an if statement to determine when myCon is null when no item of ListBox2 is selected like the following.
<br />
Dim i As Integer<br />
Dim myCon As OdbcConnection<br />
Dim cmd as OdbcCommand<br />
myCon = New OdbcConnection("Driver={MySQL ODBC 3.51Driver}; Server=myServer;Database=myDB;User=myUserassword=myPass;Option=3;")<br />
<br />
For i = 0 To ListBox2.Items.Count - 1<br />
If ListBox2.Items(i).Selected Then<br />
<br />
cmd = New OdbcCommand("SELECT * FROM myTable where Professions = '"& ListBox2.Items(i).Text &"' ")<br />
End If<br />
Next<br />
If Not IsNothing(myCon) then <br />
myCon.Open()<br />
<br />
cmd.Connection = myCon<br />
<br />
Dim ds As New DataSet<br />
<br />
Dim ad As New OdbcDataAdapter(cmd)<br />
<br />
ad.Fill(ds)<br />
<br />
Me.ListBox2.DataSource = ds<br />
<br />
Me.ListBox2.DataTextField = "Professions"<br />
<br />
Me.ListBox2.DataBind()<br />
End IF<br />
When viewed in the browser I get the exception "Object reference not set to an instance of an object". I have read that the most common causes of this exception are not declaring the variables before using them, bad scoping, and not using the key word New when instantiating. I thought I have made sure that the afore mentioned causes are not the causes of the error I'm getting but obviously there is something wrong with my code. Please help me identify the cause of the exception, I just can not see what it could be at the moment. Thank you in advance for your help.
|
|
|
|
|
What's wrong with the selectedItem property ?
When you get this error, you need to step through the code and work out what is Nothing. You really have a list box called 'ListBox2' ???
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This has popped up a few times Christian, links to the MSDN entries on the ListBox class have been provided at least once before, but I don't think the poster has a lot of, (if any), understanding of the responses that have been given thus far, or of what he's doing.
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
There are a couple of things you can do here. The first (and best) case would be to set a breakpoint at the first line of code and step through the function to see where it breaks. If you watch the variables as you step through, you should be able to figure out where the null value is quite quickly.
The second method would be to wrap this up in a Try/Catch block and set a breakpoint in the Catch. The exception that was thrown would contain full information including a stack trace which you can use to identify which line of code is failing.
My choice - go with option 1. Part of becoming a professional programmer is learning how to debug code effectively. As a general note, you should only come to CP if you have a problem after you have stepped through the code. Seriously, debugging the code is a great way to learn how to problem solve.
|
|
|
|
|
I have a gridview that loads about 2-50 records. While the query in SQL Query analyzer takes less than a couple seconds to run it takes forever for the gridview to load the data from an sqldatasource in sqldatareader mode. Has anybody has experienced somtehing like this?
|
|
|
|