|
Ok, so I'm trying to get SQL Express on my home machine. Already tried downloading and installing it on the work machine, but for whatever reason it didn't work. This is fine, because I don't really want to develop this project on the work PC anyway.
...and it looks like I might be over my head on this. Is SQL supposed to be this hard to install?
Has anyone been successful with getting some version of the server installed and functioning properly that would be willing to walk me through the process OR point me to a tutorial on how to do it?
Thanks muchly,
Michael Fritzius
|
|
|
|
|
Hi all, and thanks for all the help so far.
I've successfully gotten SQL Server 2008 running on my home machine, and can make databases, add rows/columns, everything I would need for this project.
Also, the program written to interface with the server at the local level works great.
Now I'm trying to log onto the same server and use the program to access the server remotely, from a computer on the same network, but having no success.
It gives me the following error: Login failed for user XXXX/Guest.
I know the info is getting to the server just fine, because of the nature of the error, and because I ran Wireshark to see if info was getting passed, and it was.
And, I've looked on Google and on here for a solution, but nothing seems to help.
I know that there needs to be a username/password on the SQL server itself so it knows if it can accept the incoming connection. Already tried this, but it didn't work, so I know I did something wrong... just don't know what.
If you know the answer, please help.
Thanks for all your suggestions so far and take care,
Michael Fritzius
|
|
|
|
|
Hi Everybody
In VB6 we can call GetDriveName of FileSystemObject. But i don't know how it work with in c#.
Could you please help me?
THank you
|
|
|
|
|
Use DriveInfo.GetDrives() , from the System.IO namespace.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
If you are look for lists of Drives you are right. But i am look for drive name from a give absolute path of a file.
|
|
|
|
|
OK, in that case use Path.GetPathRoot() , also in the System.IO namespace.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Short, simple and correct. 5
|
|
|
|
|
Hi. I had a photo album project and I was wondering is there anyway to retrieve the directory of images with minimum hardcoding ?
What I am currently doing now is this :
//prefix of the directory of large images
const string strLargePrefix = "/images/large/";
//suffix of the directory of large images
const string strLargeSuffix = "_large.jpg";
//group the pictures together with each of them assigned with a reference number
enum enuImages
{
//note that the first image will have its reference number
//as its position number-1.Example: 2nd image = 2-1 = reference number 1
cHTP3 =0, //1st image
cppHTP4 = 1, //second image
csharpFEP1 = 2,//third image
jHTP4 = 3, //4th image
jwsFEP1 =4, //5th image
vbnetFEP1 = 5 //6th image
}
RetrieveData()
{
// An enumeration object that represents the images based on their
// reference number. Initial reference set to 1st image
enuImages m_Images = 0;
//Array index of the image to be stored at base on their reference number.
//Index number has the same value as reference number.
int intIndex = 0;
//Retrieve directory path of the Large images and sort them
for (intIndex = 0; intIndex < int_TotalImages; intIndex++ )
{
strLargeImage[intIndex] = Directory.GetCurrentDirectory() +
strLargePrefix + m_Images + strLargeSuffix;
m_Images++;//increment the reference number to represent next image
}// end for loop
}
I dont really like the idea of grouping the images together because I have to hard code the names of the image file. But I have no choice as it works with the for loop. Is there any method that behaves like the file.ReadAllLines() that can retrieve all the images from that folder and return them as a form of array ?
|
|
|
|
|
Sure, it is basically just a file search operation for image file types. Use the DirectoryInfo.GetFiles() method with one of the overloaded versions that allows you to pass a file search pattern (*.gif , for example). The GetFiles() method is an instance method so you have to create an instance of the DirectoryInfo object for the directory you're working with. Also, one of the overloads allows you have it search subdirectories, which is pretty handy if your files may be in multiple subfolders.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
|
Hi,
This is murali.I have one question.
How to upload an email in to VSS through Dotnet coding?
If any one knows,Please let me know.
Thanks,
Murali
|
|
|
|
|
I suppose, one way could be that you save the email to a file (for example to an eml-file if it's from Outlook), and after that you add the file to Source Safe. This would require using interop against Outlook and Source Safe.
|
|
|
|
|
|
Wild guess - something to do with Unicode/CodePage? If you open the file up using the binary editor is every other character zero?
Regards,
Rob Philpott.
|
|
|
|
|
Ok. Dont know why my solution didnt work... but i've modified it a bit - a bit of a hax :P
If i putted '\\' char to search... it found something. What did it found - i dont know... but it wasn't right.
So, i've tried this - created a new textbox and enter one character inside - the '\'. And with this IT WORKED.
So, here is the new code, that works if anyone's intrested.
PS: thanks for your reply Rob.
public void DoYourThingBaby()
{
string pot = @Application.StartupPath + @"\" + lstFILES.SelectedItem;
StreamReader sr = new StreamReader(pot);
string tempF = sr.ReadToEnd();
sr.Close();
char[] tempC = tempF.ToCharArray();
int stevc=0;
foreach(char chr in tempC)
if(chr==Convert.ToChar(textBox1.Text))
stevc++;
}
Regards,
Matjaž
|
|
|
|
|
Can I ask what the point in the final 3 lines are below?
Matjaž Grahek wrote: string pot = @Application.StartupPath + @"\" + lstFILES.SelectedItem;
StreamReader sr = new StreamReader(pot);
string tempF = sr.ReadToEnd();
sr.Close();
Seems a bit of a WTF to me.
|
|
|
|
|
Bah... it IS WTF but its easier for my understanding... dont even bother with this.
Programming is cool because of this - you have soooooo many different ways to make a program work.
Regards,
Matjaž
|
|
|
|
|
Just Split() the string on the char you want to count, the count will be the number of resulting array elements minus 1 (have to escape the backslash as '\\' ). Most likely your results were thrown off by the escaping of special characters in the text (CRLF becomes \r\n , TAB becomes \t , etc.) and perhaps it brought them over into the char[] in that manner. Either way, this will do the trick:
public void DoYourThingBaby()
{
string pot = @Application.StartupPath + @"\" + lstFILES.SelectedItem;
if(!System.IO.File.Exists(pot))
return;
int count = System.IO.File.ReadAllText(pot).Split('\\').Length - 1
}
Keep It Simple Stupid! (KISS)
|
|
|
|
|
You can use LINQ to accomplish the same thing in a more expressive manner:
int bkslashCount = 0;
string pot = Path.Combine(Application.StartupPath, lstFILES.SelectedItem);
if (File.Exists(pot))
{
string data = File.ReadAllText(pot);
bkslashCount = data.ToCharArray().Where(c => c == '/').Count();
}
|
|
|
|
|
Hi,
probably a lot cheaper is count=str.Length-str.Replace("\\","").Length;
|
|
|
|
|
hey ppl, am developing an excel com add-in using c# and displaying certain data over excel sheets. How can i make a cell or a range of cells or some arbitrary cells "read-only" using c# code?!
|
|
|
|
|
There is no "ReadOnly" attribute for cells or worksheets. You have to do this the exact same way you would if youwere to do it in Excel itself. Turn on the "Locked" property of the cell, then call the method to protect the worksheet to turn on all the protection. I don't the exact code or classes/methods to use since I don't normally do Office interop.
|
|
|
|
|
Erm, i know this process, but was not finding a way to protect my active sheet. It would be gr8 to get the exact code to do so.
Thanks.
|
|
|
|
|
A little Googling found this[^].
|
|
|
|
|
I did try it before but, I want the remaining cells to remain unlocked!!where as this is protecting my entire sheet. I want for example, only my active cell to be made readonly. what has to be done then?
|
|
|
|