|
Maybe some info in the SQL Server 2008 SP1 release notes[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you, I go to see the release notes and the SQL Servers installers options this weekend.
Greatings.
|
|
|
|
|
I solved the problem, an msi file from installer was with other name.
Thanks very much.
|
|
|
|
|
I get the following error msg while compiling the code.
1. Cannot implicitly convert type 'System.Data.SqlClient.SqlDataReader' to 'System.Data.SqlClient.SqlDataAdapter'
2. 'System.Data.SqlClient.SqlDataAdapter' does not contain a definition for 'Read'
public static List<class1> GetEmp()
{
List<class1> GetEmp = new List<class1>();
SqlConnection conn = new SqlConnection(@"server=XXXX; Initial Catalog=xxxxxx");
SqlCommand cmd = new SqlCommand("Select EmpId, Name, Address from tblTemp", conn);
using (conn)
{
conn.Open();
SqlDataAdapter dr = cmd.ExecuteReader();
while (dr.Read())
{
GetEmp.Add(new Class1(dr["EmpId"].ToInt, dr["Name"].ToString(), dr["Address"].ToString()));
}
}
return GetEmp;
}
|
|
|
|
|
thecodeprojectPankaj wrote: SqlDataAdapter dr = cmd.ExecuteReader();
There's your problem. You should use this as a SqlDataReader instead.
SqlDataReader dr = cmd.ExecuteReader(); BTW - you have quite a few resource issues here - you have resources which need disposing which you haven't, you haven't closed your connection anywhere.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
Using .NET 3.5, SQL Server 2005 and C# 2008 Express.
Server creates instances of the server-side code.
Worked fine under XP. Upgraded to Windows 7 and the remote calls hang.
If I add code to my client which accesses the database directly (inserted before it does the remote call, it works. But not remotely through the server.
Is there something I should know about SQL Server/.NET/Windows 7?
|
|
|
|
|
The information you provided is not enough. What is your app doing and where does it hang ? And what does remote call mean, WCF, Web Service or a remoting component ?
|
|
|
|
|
Not clued up on terminology, so will give examples.
The first step that the app does is collect the username and logon, and then check if they are in the database.
I am using interfaces to the server-side code, and the server creates instances of the code like this
UserList insUserList = UserList.Instance;
ObjRef refUserList = RemotingServices.Marshal(insUserList, "UserList");
The client does a call like this
private IUserList rmUserList;
rmUserList = (IUserList)Activator.GetObject
(typeof(IUserList),
System.Configuration.ConfigurationManager.AppSettings["UserListUrl"]);
logonReturnValue = rmAllUserList.Logon(PasswordString);
UserListUrl is tcp://localhost:50050/UserList
On the server side it does (through calls to a pool of common routines, also on the server.
cnStr = "Data Source='NIGEL-PC\\SQLEXPRESS';" +
"Trusted_Connection=true;" +
"Database=timesheet";
cn = new SqlConnection(cnStr);
cmd = new SqlCommand("", cn);
da = new SqlDataAdapter();
cmd.CommandText = "SELECT Password " +
"FROM UserList " +
"WHERE UserID = 12 ";
da.SelectCommand = cmd;
tmpDS = new DataSet();
da.Fill(tmpDS, "Data");
If I run the above code snippet in ClientLogon it works. If I allow it to do the remote call, it hangs.
|
|
|
|
|
More info:
On the server side, I created a routine that only returns a string "OK", with no data access. Still hangs, so it is definitely the remoting bit, not the data access.
|
|
|
|
|
If anyone is interested, the problem was with Comodo Internet Security, even when diasabled.
|
|
|
|
|
gud morning friends
when i run my aaplication in vs 2005
i get the message
" unable to connect to vs local host web server "
i searched i foun d that thers a file callede webdev.webserver.exe
and i deleted it and copied from another system
it worked fine but only 1 time
now the same problem is occuring again
plz. do help
|
|
|
|
|
Probably you'll need to redelete and recopy every programming session.
|
|
|
|
|
Can't find it using search.
I can generate the .snk file using sn.exe -k. But I have forgotten how to generate the .pfx file. I upgraded to Windows 7 so of course I have lost it, and now when I compile I have to supply the password for every file in my solution!!
|
|
|
|
|
Hi,
I had the same problem and as far as I remember, I created a new pfx with the same name + known password and replaced it.
|
|
|
|
|
That is exactly my problem - how do I create the pfx file?
|
|
|
|
|
Create a new project (a dummy one) in the project properties go to the signing tab, click sign this assembly, under the choose name key label, select new from the combo box and create it. There is a manual way to make it from command line but right now, I can only trace back this one.
|
|
|
|
|
I am starting to remember now. And then you say "Password protect it". Ta.
|
|
|
|
|
hi
i used the following code..
-------------------------------------------------------
Microsoft.Office.Interop.Word.ApplicationClass wordApplication = new ApplicationClass();
object o_nullobject = System.Reflection.Missing.Value;
object o_filePath = "C:\\bok_doc.docx";
object o_format = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatHTML;
object o_encoding = Microsoft.Office.Core.MsoEncoding.msoEncodingUTF8;
object o_endings = Microsoft.Office.Interop.Word.WdLineEndingType.wdCRLF;
object o_Readonly = true;
Microsoft.Office.Interop.Word.Document doc = wordApplication.Documents.Open(ref o_filePath,
ref o_nullobject, ref o_Readonly, ref o_nullobject, ref o_nullobject, ref o_nullobject,
ref o_nullobject, ref o_nullobject, ref o_nullobject, ref o_nullobject, ref o_nullobject, ref o_nullobject, ref o_nullobject, ref o_nullobject,
ref o_nullobject, ref o_nullobject);
Microsoft.Office.Interop.Word.Document doc1 = wordApplication.ActiveDocument;
string m_Content = doc1.Content.Text;
// sp.InnerHtml = m_Content;
// the content is stored into the textbox.
//TextBox1.RenderControl(
TextBox1.Text = m_Content;
------------------------------------------------------------------------------------------------------
it work fine for me but it does not carry the formating done in the ms-word , it shows all the content in the plain text ... can any body please help me out , in order to show the content in the same format as it was in word (docx)
vimal kumar
System Engineer
Infosys,Mysore,India.
|
|
|
|
|
Print the Word doc on the fly to an XPS document, and then load the XPS document into a WPF DocumentViewer control in a WPF window or host the Viewer in a Windows Form.
|
|
|
|
|
hi
would you please provide me the detail to how i can resolve the problem..
since i had never used the XPS format ..
and how i will be reading that format using asp.net (C#)..
to display the content in the textbox.
regard
vimal
|
|
|
|
|
You didn't mention that you were using ASP.NET in your original question.
Since that's the case, just open the Word document in an new IE Window and forget about using a control. XPS documents can be opened in IE also; so, no difference in that case.
(And I said to use a "DocumentViewer" control for XPS; not a TextBox. In any case, a DocumentViewer can only be hosted in Windows).
|
|
|
|
|
vimalkumarsinghal wrote: it work fine for me but it does not carry the formating done in the ms-word , it shows all the content in the plain text
Of course it doesn't work! First of all, the TextBox control doesn't know anything about Word formatting and cannot render what it doesn't know how to do. Second, you're getting only the text from the Word document, not the formatting.
Basically, you can't do what you want using a TextBox control.
|
|
|
|
|
Save the word document as RTF and use RichTextBox to display the content.
|
|
|
|
|
hi
Do we have the richtextbox control in asp.net 3.5..
would you please guide me the way i can achieve this..
regard
vimal
|
|
|
|