|
It did.
Once again, thank you Ben.
|
|
|
|
|
|
unable to set connectionstring property of Sqldatasource used with gridView dynamically in asp.net 2.0 using c#
after using it
getting Exception :The connection name 'ConnectionString' was not found in the applications configuration or the connection string is empty.
in syntax <%$ConnectionStrings:ConnectionString%>
I'm thinking string after : is the key used in web.config file is it correct?
Please guide what is gone wrong?
following is the code snippet:
<asp:sqldatasource id="SqlDataSourceCat" runat="server" connectionstring="<%$ConnectionStrings:ConnectionString%>" updatecommand="UPDATE DXCategory SET CategoryName =@CategoryName Where CategoryId=@CategoryId" selectcommand="SELECT [CategoryID], [CategoryName] FROM [DXCategory] order by CategoryId desc">
<updateparameters>
<asp:parameter name="CategoryName">
<asp:parameter name="CategoryID">
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
Does your web.config have a ConnectionString with the name 'ConnectionString'? Because the code you provided (though only visible in html source) assumes so.
|
|
|
|
|
thank you Szukuro for reply.
Yes, web.config have a ConnectionString with the name 'ConnectionString' set as key name .
now i tried with another syntax as follows in aspx page
ConnectionString="ConnectionStrings:ConnectionString"
This is not giving exception but dat is not getting bound to the repeater.
Please guide.
Thank you.
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
Does anyone know where I can find this property of the new GridView control
<PagerStyle Position="TopAndBottom"
It tells the control where to put it's paging numbers.
Thanks
|
|
|
|
|
You will need to re-post with the Ignore HTML tags check box checked. Can't see what property you are asking about. Paging does work differently in a gridview, especially if you are using a sqldatasource or an objectdatasource.
Ben
|
|
|
|
|
you have to use VS 2005 and asp.net 2.0.
Gridview controls are not come free with any package.
All The Best
Sathesh Pandian
|
|
|
|
|
Sorry the tag disspeared. It was the property that puts the pager at the bottom and the top of the results. At the moment, be default it is at the bottom. I want it to be at the top and the bottom of the results. Any ideas cos i cant find the property?
|
|
|
|
|
There is now a pagersetting object/property that has the top and bottom settings in the position property.
Ben
|
|
|
|
|
Hi,
I would like to know how i can perform update or delete by using Update method of sql data adapter. I have done the insert operation using update method. The code follows...
<br />
public Boolean SetStorageArea(int UID, DataTable dtStorageArea)<br />
{<br />
string strSql;<br />
strSql = "SELECT [Active],[WarehouseID],[StorageAreaID],[StorageAreaShortName],[StorageAreaName], " +<br />
" [Alias],[Notes],[CreatedBy],[CreatedOn],[LastModifiedBy],[LastModifiedOn] FROM [StorageArea]";<br />
try<br />
{<br />
DataSet dsStorageArea = new DataSet();<br />
dsStorageArea.Tables.Add(dtStorageArea);<br />
SqlDataAdapter sda = new SqlDataAdapter(strSql, sqlcon);<br />
SqlCommandBuilder sqb = new SqlCommandBuilder(sda);<br />
sda.Update(dsStorageArea, "StorageArea");<br />
return true;<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
<br />
throw new Exception("SetStorageArea: Could not get the records of all Storage Areas.\nOriginal message: " + Ex.Message);<br />
}<br />
}<br />
.
awaiting for your valuable suggestions..
Thanks in advance
Sebastian
|
|
|
|
|
Hi Sebastian ,
I never used command builder ..i use sqlcommand object..check if it works for u ...
SqlCommand updatecmd = new SqlCommand(strSql, sqlcon);
SqlCommand deletecmd = new SqlCommand(strSql1, sqlcon);
SqlCommand insertcmd = new SqlCommand(strSql2, sqlcon);
SqlDataAdapter sda = new SqlDataAdapter();
sda.UpdateCommand = updatecmd; //here cmd generater for update
sda.DeleteCommand = deletecmd; //here cmd generater for delete
sda.InsertCommand = insertcmd ; //here cmd generater for insert
sda.Update(dsStorageArea, "StorageArea");
pallavi
|
|
|
|
|
Hi Pallavi,
Thank you very much. This method will work, the only thing is i have to avoid command builder...
Thanks once again
Sebastian
|
|
|
|
|
Hi,
I have designed a registration form using wizard control in asp.net2.0. it consists of 5 steps.
In steps 1, 2 and 4 there are some mandatory fields where the user has to fill. I kept some validations for that in those steps.
My Issue:
How can i make sure(reconfirm) in 5th step that the user has filled all the required fields in previous steps.
Please let me know your suggestions.
Many Thanks!!
Jagadeesh
|
|
|
|
|
Dear jagadeesh,
use validators like requiredfield validator etc..
then in the page_load you can check it through
page.Isvalid.
If you want to check them means use some validation summary to view the
errors otherwise use javascript for validating the data.
All The Best
Sathesh Pandian
|
|
|
|
|
Hello Sathesh Pandian,
Page.IsValid doesn't work in wizard control's finish button click event.
To be more clearer on the question i mentioned above 5 steps which means 5 different wizard pages, but not 5 input fields.
In the 5 wizard pages I kept some validations in pages 1, 2 and 4 along with validation summary controls in those three pages.
My Issue:
How can i make sure(reconfirm) in 5th step that the user has filled all the required fields in previous wizard control pages.
Please let me know how to resolve this issue.
Many Thanks!!
Jagadeesh
|
|
|
|
|
Hi i have one datagrid in that i have my dropdownlistbox...,
When i am loading some datas in my datagrid...,
Based on that data,my dropdown box data also want to display...,
Example:
if i load an employee id in that datagrid..,
Based on that employee id, his/her name want to display in that dropdown list box...,
How to do that?,
Plz help me...,
Regards,
Magi
|
|
|
|
|
Hi Magi,
consider one example. If my dropdown list have datasource which conatin employee id and employee name. your display field will be employee name and value field will be employee id. so if your datagrid is having datasource in which it contains employee id column.
it will show respective name in dropdown list column...
pallavi
|
|
|
|
|
how can I add mailed-by header to mailmessage object???
I am using
newMail.Headers.Add("Mailed-By","rebuscode.com");
but it is not showing mailed by in the header of the mail recieved by user.
hiiiiii
hiiiiii
|
|
|
|
|
Don't Repost.
Regards,
Satips.
|
|
|
|
|
Compiler Error Message: BC30002: Type 'ADODB.Command' is not defined
We are migrating asp site to asp.net after conversion of a page in asp.net when we are trying to run that page we are getting this error.
<%
Dim gi_LoginOptional As Object
Dim displayHeader As Object
Dim cmd As ADODB.Command
Dim con4 As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim g_IsLoggedIn As Boolean
Dim displayFooter() As Object
Dim i As Integer
Dim g_HasLoggedIn As Boolean
Dim rs2 As ADODB.Recordset
Dim writeOneOption As Object
Dim MemberOpen() As Object
Dim loginURL As String
Dim headAdd As String
%>
Compiler Error Message: BC30002: Type 'ADODB.Command' is not defined
Thanks In Advance
Narendra
|
|
|
|
|
in asp .net there will be two files of a particular page. one is aspx i.e. design that contains html and asp tags will be there and another is aspx.vb or aspx.cs (code behind file) depending upon your language selection.
you have to declare all your variables and objects in that code behind file that contains the logic of your page and it also handles events of the controls.
you want to access adodb that you need to add reference of it. right click on solution explorer and click on add references and select your particular reference now you need to imports (vb) or using (c#) that adodb name space in your code behind file and you can access all its classes.
-- modified at 9:22 Friday 29th June, 2007
|
|
|
|
|
divyesh1432 wrote: you have to declare all your variables and objects in that code behind file that contains the logic of your page and it also handles events of the controls.
Not true. The code-behind file is not required. Using tag < you can have your code in the presentation file. Not recommended, but still possible.
<div class="ForumSig"><hr>only two letters away from being an asset</div>
|
|
|
|
|
Hi,
I am very much thankful to your reply.
We have included ADODB to the reference but still it is Showing same Error.
Below is Our Migrated code:
<%@ Import namespace="ADODB" %>
<%@ page language="VB" aspcompat="true"%>
<%
Dim gi_LoginOptional As Object
Dim displayHeader As Object
Dim cmd As ADODB.Command
Dim con4 As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim g_IsLoggedIn As Boolean
Dim displayFooter() As Object
Dim i As Integer
Dim g_HasLoggedIn As Boolean
Dim rs2 As ADODB.Recordset
Dim writeOneOption As Object
Dim MemberOpen() As Object
Dim loginURL As String
Dim headAdd As String
%>
<%
'temp send everyone to homepage, per joey. -rmesard 23-apr-2007
'response.Redirect "content.asp?from=index"
'response.end
con4 = New ADODB.Connection
rs1 = New ADODB.Recordset
rs2 = New ADODB.Recordset
cmd = New ADODB.Command
%>
It si Showing the Error As
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'ADODB.Command' is not defined.
Source Error:
Line 9: Dim gi_LoginOptional As Object
Line 10: Dim displayHeader As Object
Line 11: Dim cmd As ADODB.Command
Line 12: Dim con4 As ADODB.Connection
Line 13: Dim rs1 As ADODB.Recordset
Source File: http://localhost/wlb2003/index.aspx Line: 11
Thanks and Regards
Narendra
|
|
|
|
|
Hi,
I am very much thankful to your reply.
We have included ADODB to the reference but still it is Showing same Error.
Below is Our Migrated code:
<%@ Import namespace="ADODB" %>
<%@ page language="VB" aspcompat="true"%>
<%
Dim gi_LoginOptional As Object
Dim displayHeader As Object
Dim cmd As ADODB.Command
Dim con4 As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim g_IsLoggedIn As Boolean
Dim displayFooter() As Object
Dim i As Integer
Dim g_HasLoggedIn As Boolean
Dim rs2 As ADODB.Recordset
Dim writeOneOption As Object
Dim MemberOpen() As Object
Dim loginURL As String
Dim headAdd As String
%>
<%
'temp send everyone to homepage, per joey. -rmesard 23-apr-2007
'response.Redirect "content.asp?from=index"
'response.end
con4 = New ADODB.Connection
rs1 = New ADODB.Recordset
rs2 = New ADODB.Recordset
cmd = New ADODB.Command
%>
It si Showing the Error As
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'ADODB.Command' is not defined.
Source Error:
Line 9: Dim gi_LoginOptional As Object
Line 10: Dim displayHeader As Object
Line 11: Dim cmd As ADODB.Command
Line 12: Dim con4 As ADODB.Connection
Line 13: Dim rs1 As ADODB.Recordset
Source File: http://localhost/wlb2003/index.aspx Line: 11
Thanks and Regards
Narendra
|
|
|
|