|
<code>SqlCommand cmdDesign = new SqlCommand();
cmdDesign.Connection = Cn;
cmdDesign.CommandType = CommandType.StoredProcedure;
cmdDesign.CommandText = "EIS_spGetEmployeeCategory";
cmdDesign.Parameters.Add("@User_Id", SqlDbType.Int).Value = intUserId;
SqlDataAdapter daDesign = new SqlDataAdapter();
daDesign.SelectCommand = cmdDesign;
daDesign.Fill(ds, "EmpCat");
SqlCommand cmdEdu = new SqlCommand();
cmdEdu.Connection = Cn;
cmdEdu.CommandType = CommandType.StoredProcedure;
cmdEdu.CommandText = "EIS_spGetEmployeeBasicQualificationList";
cmdEdu.Parameters.Add("@Id", SqlDbType.Int).Value = intUserId;
SqlDataAdapter daEdu = new SqlDataAdapter();
daEdu.SelectCommand = cmdEdu;
daEdu.Fill(ds, "EmpEdu");
string fileName = Server.MapPath(".");
fileName = fileName + "\\Templates\\Resume_Template2.xml";
XmlDocument xmlTemplateDoc = new XmlDocument();
xmlTemplateDoc.Load(fileName);
CExWordMLFiller wfiller = new CExWordMLFiller(ds, xmlTemplateDoc.OuterXml);
wfiller.Transform();
string copyFileName = Path.GetTempFileName() + ".xml";
wfiller.WordMLDocument.Save(copyFileName);
Response.Clear();
Response.ContentType = "application/msword";
Response.Charset = "";
Response.AddHeader("Content-disposition", "inline: filename=" + copyFileName + "");
Response.WriteFile(copyFileName);
Response.Flush();
Response.Close();
</code>
This was the code i used earlier.But i want to split this code so that each dataset in separate functions in class.There comes the trouble. CExWordMLFiller wfiller = new CExWordMLFiller(ds, xmlTemplateDoc.OuterXml);
This 'ds' comprises all datasets..
This is the new code..:
<code> public DataSet GetEmployeeCategory (int userId)
{
DataView dvTemplate = null;
int templateId=0;
string SP = DBObjectName.spGetEmployeeCategory;
Hashtable htParameters = new Hashtable();
htParameters.Add("@User_Id",MISUtility.CheckNull(templateId));
DataSet EmpCat = new DataSet();
try
{
OpenConnection();
dvTemplate = Connection.ExecuteProcedure(SP,htParameters);
DataTable dtTmp = dvTemplate.Table;
EmpCat.Tables.Add(dtTmp);
}
catch(Exception e)
{
throw new MISException("AdvancedReport.GetEmployeeCategory() failed",e);
}
finally
{
CloseConnection();
}
return EmpCat;
}
public DataSet GetEmployeeBasicQualification(int userId)
{
DataView dvTemplate = null;
int templateId=0;
string SP = DBObjectName.spGetEmployeeBasicQualificationList;
Hashtable htParameters = new Hashtable();
htParameters.Add("@User_Id",MISUtility.CheckNull(templateId));
DataSet EmpEdu = new DataSet();
try
{
OpenConnection();
dvTemplate = Connection.ExecuteProcedure(SP,htParameters);
DataTable dtTmp = dvTemplate.Table;
EmpEdu.Tables.Add(dtTmp);
}
catch(Exception e)
{
throw new MISException("AdvancedReport.GetEmployeeBasicQualification() failed",e);
}
finally
{
CloseConnection();
}
return EmpEdu;
}
</code>
<code>private void GetResumeMergeFields()
{
try
{
ResumeTemplate obj = new ResumeTemplate();
//DataSet EmpCat = obj.GetEmployeeCategory();
string fileName = Server.MapPath(".");
fileName = fileName + "\\Templates\\Resume_Template2.xml";
XmlDocument xmlTemplateDoc = new XmlDocument();
xmlTemplateDoc.Load(fileName);
CExWordMLFiller wfiller = new CExWordMLFiller(ds, xmlTemplateDoc.OuterXml);
wfiller.Transform();
string copyFileName = Path.GetTempFileName() + ".xml";
wfiller.WordMLDocument.Save(copyFileName);
Response.Clear();
Response.ContentType = "application/msword";
Response.Charset = "";
Response.AddHeader("Content-disposition", "inline: filename=" + copyFileName + "");
Response.WriteFile(copyFileName);
Response.Flush();
Response.Close();
}
catch(Exception ex)
{
throw new MISLogException(this.MISRecordFetchErrorMessage,ex);
}
}</code>
ds in GetResumeMergeFields() in getting error...
Please help...
|
|
|
|
|
A datatable will have only one table but a dataset can have multiple tables.
If you have data required from two tables then join those multiple tables and assign to a dataset then further to a datatable.
I guess....
Gautham
|
|
|
|
|
Can u please explain how can i write the code for that...
Thankin u in anticipation.
|
|
|
|
|
hi friends
i have on ascx user control
on user control i have three textboxes
which are invisible
i have one button on ascx
when i press this button
these textboxes will get visible
when it gets visible i want to set focus on
one of these textbox
so i write one javascript
and form load
i write
btnAdd.Attributes.Add("OnClick","Setfocus()")
but in this case js code will execute first
text boxes are invisible
and i am not able to refer these textboxes in js
so i am not able to set focus
how can i solve this or any other way to solve this issue
pls help
thanks
|
|
|
|
|
btnAdd.Attributes.Add("OnClick","Setfocus()") ?
Are you writing it in ascx page load ?
that is important
In javascript only make them visible before seting focus
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Can't you make the Textbox read only first then after button click write javascript to make readonly =false and set the focus
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
If you use the Visible property of the server controls to make the text boxes invisible, they are not rendered to the final page, so they doesn't exist in the page at all. You can't access something that doesn't even exist.
You have to use any of the css properties display or visibility to hide the text boxes, so that they still exist in the page and can be made visible by changing the css style from Javascript.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello
can you please help me.After the user selected the project from dropdownlist,I want the name of all the members working under that project to be displayed in the listbox.Please help me with the code for that.
oga m
|
|
|
|
|
Attach SelectedIndexChanged event to the dropdown.
And in the event connect to database to get all members
Nana
|
|
|
|
|
Private Sub dropdownlist1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dropdownlist1.SelectedIndexChanged
dst = New DataSet
sqldad = New SqlDataAdapter("SELECT employee from tablename where projectname=val(dropdownlist1.selecteditem.value)", sqlconn)
sqldad.Fill(dst)
dst.Tables(0).TableName = "tblMainGRD"
If dst.Tables("tblMainGRD").Rows.Count > 0 Then
Me.btnSubmitStock.Visible = True
listbox1.DataSource = dst
listbox1.DataBind()
Else
Me.btnSubmitStock.Visible = False
listbox1.DataSource = Nothing
listbox1.DataBind()
End If
sqldad.Dispose()
dst.Dispose()
End Sub
Magesh
|
|
|
|
|
Under SlectedIndexChanged event of dropdownlist write the code.
Based on the selected value of the dropdownlist, fetch the name of all the members from database and then bind the datalist with the data retrieved.
|
|
|
|
|
hi
am a beginner in (programming)asp.net(vb).I have Submit to the manager button,how can I code it so that when the user clicks it ,it submit the information displayed in the datagrid to the manager by e-mail for approval.
oga m
|
|
|
|
|
Use System.Web.Mail for sending email
Nana
|
|
|
|
|
|
Iam developing a web based payroll system using Visual Studio 2005 and
ASP.Net. I would like to have certain clarification on the following line.
I would like to pick employee name from a list which contain multiple
colums with employee name,employee id,department as coumn headers. For this
if I use combobox - it can contain only one column, if I use listview and if
the no of employees are high the selection will become too slow. Can you
suggest any control which will support multiple columns and multiple records
(rows) with an area to enter some text value (employe name) which is to be
serched with in the displayed list ?
I also would like to know about a control (feature ) which supports data
entry in a grid format (rows and columns - Excel like data entry). The grid should suport data entry directly in to a cell. The grid also should suport data binding. I should be able to customise the column/cell format into textbox,combobox, etc. Is there any such inbuilt control available with Visual Studio 2005 ans ASP.Net ? If not, is it advisible to build a user control by ourself or buying a provern third party control ? If third party control is advisable can you suggest a well known and widely used one ?
Rajeev
|
|
|
|
|
I would suggest a datagrid for both of these things - for the first one add a check box column and for the second you need the grid to be in edit mode always.
|
|
|
|
|
Hi all
Can any one please tell me Y iam getting Login failed for user 'QQQ\ASPNET' ERROR
But i given right user name and password
---------------------------------------
Dim pkg As New DTS.Package
pkg.LoadFromSQLServer("QQQ", "sa", "sa", _
DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, "DSS6", "{FD8467BD-0FED-4F78-8F7A-C58A7E061AF7}", _
"{F987D202-6553-42AC-9CFE-41DC46E5EB90}", "ExcelPack3", "")
pkg.Execute()
Label1.Text = "Package Executed"
---------------------------------------
Thank Q
|
|
|
|
|
You are running under the default aspnet account (anonymous access). This user does not (and probably should not) have permission to access your database.
|
|
|
|
|
Hi friends,
While adding the web service(ie., *.asmx) file into a new asp.net web project i am getting the following error. It is showing the error at the first letter "<@". Can you tell me how to resolve this.
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
A name was started with an invalid character. Error processing resource 'http://localhost/MyWebProjects/WebSite1/Service.as...
<%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="WService.Service" %>
-^
VijayaRam
|
|
|
|
|
Open the .net command prompt and run the following commands:
1) aspnet_regiis.exe –i
2) aspnet_regiis.exe –e
and finally restart the IIS
Gautham
|
|
|
|
|
As you told,i have done, but no use, I think the error may be in asmx file. it is telling file cannot begin with % character. Do you know how to register the asmx file in the project.
Thanks in advance.
this is the error:
The document at the url http://localhost/MyWebProjects/WebSite1/Service.asmx was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2.'.
- Report from 'WSDL Document' is 'There is an error in XML document (1, 2).'.
- Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2.
- Report from 'XML Schema' is 'Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2.'.
VijayaRam
|
|
|
|
|
I read somewhere that it could be a problem with the machine.config.
I guess in machine.config you have a add verb tag, make sure this tag is not uncommented!! i will search for the solution too if it does not work.
Gautham
|
|
|
|
|
register .asmx extention in your IS
|
|
|
|
|
hi,
i have executed a query and got the resultant data into a DataSet. now i need to further filter this data based on a condition. i dont want to run a query again and create a seperate dataset for this task.
can you please tell how to run a query on this dataset itself?
thanks
|
|
|
|
|
I think the best way is filter tha data while loading the from database using StoredProcedure
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|