|
hi all!!
I am on a project that need show the fields that have a DB, but in a APP of Desktop I haven't problem to do this.
Now in ASP I don't know do that. In a simple way to show what I do, I drop yours this code, that try to fill a dataset to show then in a crystalR.
DataSet ds = new DataSet();
sqlConn = ConnectionPool.GetConnection();
SqlTransaction sqlTrans = sqlConn.BeginTransaction();
ds = SqlHelper.ExecuteDataset(CommandType.StoredProcedu
re,"DP_GetAllEmp",sqlTrans);
sqlTrans.Commit();
sqlTrans = null;
ConnectionPool.ReleaseConnection(sqlConn);
CrystalReport1 cr1 = new CrystalReport1();
cr1.SetDataSource(ds);
CrystalReportViewer1.ReportSource = cr1; //this is the problem
//in this place exploit, and said me that the report data source isn't valid
if everybody have any idea, please say me
|
|
|
|
|
I guess ds is returning null. Please check it out.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
|
|
|
|
|
Hi all,
I am designing an employee search webform which has following search criteria:
1. Name (Dropdownlist, because I have names of all employees)
2. Grade (Dropdownlist)
3. Department(Dropdownlist)
4. Designation(Dropdownlist)
The problem is that I have to show the results for only those criteria that are selected. It is simple if I use open queries and use querybuilder, but I am restricted to use stored procedures.
Can anyone suggest me some strategy to go about it and any queries such that the values that are not selected are not considered.
Thanks in advance
|
|
|
|
|
A trick that you can use to omit a value, is to compare it with itself:
where SomeField = isnull(@SomeValue, SomeField)
If you send in a null value, the value in the field will instead be compared to itself, and therefore always match.
---
Year happy = new Year(2007);
|
|
|
|
|
Hi all,
Any help on creating a dynamic treeview in windows form where the number of children nodes is unknown at design time. I want the user to be able to create new parent and child notes.
thanks
|
|
|
|
|
Use Nodes.Add to add nodes. You can do it something like this:
TreeNode parentNode = new TreeNode("My node");
treeView1.Nodes.Add(parentNode);
TreeNode childNode = new TreeNode("childNode");
parentNode.Nodes.Add(childNode);
This code will add a top level node (My node), and then add a child node to this (childNode).
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
When a row is edited I would like to get the value of one of the data keys.
The datakey being the ID column that is not displayed on the table but is part of the SQL select statment.
So i can get the actual tables ID column value relating the to GridView row baing changed... so I can write my own update stored procedure.
-- modified at 10:28 Monday 29th January, 2007
|
|
|
|
|
Dear All,
i am bit new to the dotnet world. i am making web application using asp.net ,C# (Visual studio 2005).
i am using two dropdownlistbox which i defined as
FIRST AS
<asp:dropdownlist id="DropDownListbranch" runat="server" datasourceid="SqlDataSourcebranch"
="" datatextfield="display" datavaluefield="branchcode" style="left: 341px; position: absolute;
top: 72px" width="134px" <b="">AutoPostBack="True" AppendDataBoundItems="True" OnSelectedIndexChanged="DropDownListbranch_SelectedIndexChanged">
<asp:listitem> Select One
SECOND AS
<asp:dropdownlist id="DropDownListname" runat="server" datasourceid="SqlDataSourceid"
="" datatextfield="display" datavaluefield="agentid" style="left: 342px; position: absolute;
top: 99px" width="131px" <b="">AppendDataBoundItems="True" AutoPostBack="True" OnSelectedIndexChanged="DropDownListid_SelectedIndexChanged" TabIndex="1">
<asp:listitem>Select One
<asp:listitem>New
BOTH I FILLED AS
FIRST AS
<asp:sqldatasource id="SqlDataSourceid" runat="server" connectionstring="<%$ ConnectionStrings:HFSERVICESConnectionString %>"
="" selectcommand="Sp_name" selectcommandtype="StoredProcedure">
<selectparameters>
<asp:sessionparameter name="type" sessionfield="myna" type="String">
<asp:controlparameter controlid="DropDownListbranch" name="branch" propertyname="SelectedValue"
="" type="String">
SECOND AS
<asp:dropdownlist id="DropDownListname" runat="server" datasourceid="SqlDataSourceid"
="" datatextfield="display" datavaluefield="agentid" style="left: 342px; position: absolute;
top: 99px" width="131px" appenddatabounditems="True" autopostback="True" onselectedindexchanged="DropDownListid_SelectedIndexChanged" tabindex="1">
<asp:listitem>Select One
<asp:listitem>New
Actually i want along with data in second dropdownlist box there alway be option of Select one and new.where i am going wrong ? please guide me.
thanks
regards
imran khan
|
|
|
|
|
HI Imran
i think you want "Select One" item at 0th index ?
Simply add this in page load
DropDownList1.Items[0].Text = "Select One";
There are many methods using which you can add this most simple
I think it solve your problem
|
|
|
|
|
Here is another way
DropDownList1.Items.Insert(0, "Select many");
instead of string as second parameter you have one more overloaded method see it
Enjoy coding
|
|
|
|
|
I want to insert some string value at location where cursor is pointing in textbox.
Suppose a Textbox have contents like ABCDE and cursor is blinking after 'C',
- ABC|DE
and I want to insert a string str = "XYZ" at this position on some button click.
For eg. by using Textbox1.Text.Insert () or some other method.
and here I need current cursor position in textbox.
I am not entering text by keybord.I want it to be inserted on button click.
Got it ?
-- modified at 1:25 Tuesday 30th January, 2007
Abhijeet Beedkar.
India
|
|
|
|
|
Hi Abhijeet
Sorry i am not getting you question ? Please elaborate it
|
|
|
|
|
i am not sure what you are trying to say but
you can get cursor in the textbox while page loads using tanindex property of the textbox make it to -1
TabIndex=-1
Enjoy Coding
|
|
|
|
|
HI
I have a gridview with 5 columns.OUt of this i want to scroll one column horizontally.How to do.The scroll bar should appear only below the particular column.
If at all the scroll bar is shown horizontally below the gridview , on scrooling the bar only the desired column should be scrolled and other columns should be fixed
|
|
|
|
|
suppose there is a table for storing category and sub category info
i want fetch data from that table and show in a fashion like first category will be show
when someone will click on category then subcategory will be displayed under that category and other category will be shown also
when againg someone will click on other category then subcategory related will be show under that in tree structure style.
pls see the http://www.fishpond.com.au site. here on the left hand category is displayed when u click on any category then sub category will be displayed and when u click on sub category then product will be dispalyed in tree style.plss see the effect and tell me how could i do
the same thing in asp.net very easy way.pls tell me is there any free control available or not which can be bound very easily,
plsssss help me urgent.
tbhattacharjee
|
|
|
|
|
suppose there is a table for storing category and sub category info
i want fetch data from that table and show in a fashion like first category will be show
when someone will click on category then subcategory will be displayed under that category and other category will be shown also
when againg someone will click on other category then subcategory related will be show under that in tree structure style.
pls see the http://www.fishpond.com.au site. here on the left hand category is displayed when u click on any category then sub category will be displayed and when u click on sub category then product will be dispalyed in tree style.plss see the effect and tell me how could i do
the same thing in asp.net very easy way.pls tell me is there any free control available or not which can be bound very easily,
plsssss help me urgent.
tbhattacharjee
|
|
|
|
|
hello gurus
i m using a datagrid
i want to update and delete the database records with the datagrid.
i can update successfully.
code for update is:--------
Private Sub Dtgrd_Products_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles Dtgrd_Products.UpdateCommand
Dim txtId As TextBox = e.Item.Cells(2).Controls(0)
Dim str = txtId.Text
Dim txtName As TextBox = e.Item.Cells(3).Controls(0)
Dim txttype As TextBox = e.Item.Cells(4).Controls(0)
Dim txtdia As TextBox = e.Item.Cells(5).Controls(0)
Dim txtlength As TextBox = e.Item.Cells(6).Controls(0)
Dim txtLamType As TextBox = e.Item.Cells(7).Controls(0)
Dim txtVarType As TextBox = e.Item.Cells(8).Controls(0)
Dim txtcol1 As TextBox = e.Item.Cells(9).Controls(0)
Dim txtcol2 As TextBox = e.Item.Cells(10).Controls(0)
Dim txtcol3 As TextBox = e.Item.Cells(11).Controls(0)
Dim txtcol4 As TextBox = e.Item.Cells(12).Controls(0)
Dim txtcol5 As TextBox = e.Item.Cells(13).Controls(0)
Dim txtcol6 As TextBox = e.Item.Cells(14).Controls(0)
conn = New SqlConnection(constr)
cmd = New SqlCommand("spr_UpdateProductDetails", conn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New SqlParameter("@Id", txtId.Text))
cmd.Parameters.Add(New SqlParameter("@type", txttype.Text))
cmd.Parameters.Add(New SqlParameter("@dia", txtdia.Text))
cmd.Parameters.Add(New SqlParameter("@length", txtlength.Text))
cmd.Parameters.Add(New SqlParameter("@laminate_type", txtLamType.Text))
cmd.Parameters.Add(New SqlParameter("@varnish_type", txtVarType.Text))
cmd.Parameters.Add(New SqlParameter("@col1", txtcol1.Text))
cmd.Parameters.Add(New SqlParameter("@col2", txtcol2.Text))
cmd.Parameters.Add(New SqlParameter("@col3", txtcol3.Text))
cmd.Parameters.Add(New SqlParameter("@col4", txtcol4.Text))
cmd.Parameters.Add(New SqlParameter("@col5", txtcol5.Text))
cmd.Parameters.Add(New SqlParameter("@col6", txtcol6.Text))
conn.Open()
cmd.ExecuteNonQuery()
Dtgrd_Products.EditItemIndex = -1
conn.Close()
bindgrid()
End Sub
and for delete code is:--------
Private Sub Dtgrd_Products_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles Dtgrd_Products.DeleteCommand
Dim txtId As TextBox = e.Item.Cells(2).Controls(0)
Dim str As String = txtId.Text
conn = New SqlConnection(constr)
cmd = New SqlCommand("spr_DeleteProductDetails", conn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New SqlParameter("@Id", txtId.Text))
conn.Open()
cmd.ExecuteNonQuery()
Dtgrd_Products.EditItemIndex = -1
conn.Close()
bindgrid()
End Sub
when i m trying to delete i get the error
"Specified arguement was outside the bound of the valid values."
wht to do.
Ajay
|
|
|
|
|
MissionSuccess wrote: Dtgrd_Products.EditItemIndex = -1
I'd say that -1 is outside the bounds of valid values
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
So What should i do?
this is for edit
Private Sub Dtgrd_Products_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles Dtgrd_Products.EditCommand
Me.Dtgrd_Products.EditItemIndex = e.Item.ItemIndex
bindgrid()
End Sub
and this is for cancel
Private Sub Dtgrd_Products_CancelCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles Dtgrd_Products.CancelCommand
Me.Dtgrd_Products.EditItemIndex = -1
bindgrid()
End Sub
|
|
|
|
|
Am I on candid camera ?
Take that line out and see if it works. If so, find another way to clear the index.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
now i had commented out that line
Dtgrd_Products.EditItemIndex = -1
still gettin the same error
|
|
|
|
|
Step through your code and see which part throws the exception. If you use a Try/Catch block, the stack trace should show you where the error is. Unfortunately, you have so many parameterised variables in your code that we cannot help you here. Only debugging can save you now.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi all !
As per my client request we need to create a webaplication that which automatically get connected to the webserver duering the OS loading(like a windows service).Am not createing any downloadable files to support that (like if we want to use yahoomessanger first we have to download the corresponding EXE from the webserver...then only by makeing use of the options(connect to the server duering OS loading) we will connecte to the server duering OS loading).First of all plz let me know the fact ,is it possible to create icon for the webapplication on the desktop,plz let me know wither this scenario is valid one or not.....if it is guide me in a proper way
|
|
|
|
|
Hmm...I'm not 100% sure what you mean. Is it that you want the clients browser to load and point to the web application when the OS starts? To do that, you'd have to create a shortcut to the URL and add it to the users startup (just put it in the startup folder on the start menu on Windows). Is that what you meant?
|
|
|
|
|
In calendar webcontrol,I want to inactive some of the dates in a particular month of the calendar and also i want to assign a single color to a particular date in a particular month of the calendar.
Neelima
|
|
|
|