|
You can change the record to 0 in IsLockedOut on your aspnet_membership table. If you're using ASP.NET Membership.
Regards
Christian Amado
MCITP | MCTS | MOS | MTA
Olimpia ☆ ★★★
Please mark as answer, if it helps.
|
|
|
|
|
Hi, im a have a multiline texbox and a datagridview all c#. I want to filter the grid by the multiline textbox and need to use every single line to filter the grid. Please can somebody helm me with that??
Jaasiel
modified 3-Aug-12 7:26am.
|
|
|
|
|
Pssst....wrong forum!
Try the C# one
"Benjamin is nobody's friend. If Benjamin were an ice cream flavor, he'd be pralines and dick." ~ Garth Algar
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair
|
|
|
|
|
Yes, I can helm this by suggesting you to put your question on THIS[^] forum.
People are so bad towards kind of question here. and will constantly remind you to look at the top of the page.
Regards,
Hiren.
|
|
|
|
|
--- DO NOT ASK PROGRAMMING QUESTIONS IN THE LOUNGE ---
I'd quickly apologise and move this to Q&A if I was you.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Nagy Vilmos wrote: I'd quickly apologise and move this to Q&A if I was you.
As a newbie, It seems it will be too late till the time he realizes.
Regards,
Hiren.
|
|
|
|
|
Nagy Vilmos wrote: I'd quickly apologise and move this to Q&A if I was you.
Can we start the Univote Frenzy now, pleeez pleeeeez pleeeeeeeez?
[Edit]:
Posted this before it was moved to C# forum
[/Edit]
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|
|
I'm not overly familiar with winforms and the correct way to filter data on a datagrid view. But something like the following may help you.
var filteredItems = Items.Where(row=>textbox1.Lines.Contains(row.FilterColumn));
you may want to do something more to allow for ignoring the case of what you are filtering on, but filteredItems should be a step towards what you want.
|
|
|
|
|
With what exactly? Where will the filtering take place, on the server or on the client-machine? And how do your lines in the textbox match up with the tablenames?
Perhaps if you showed us some code that explains how you load the data in there, we might hint what the most appropriate solution could be.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Let's assume your DataGridView is already full of Data, in Cells, organized in Rows and Columns, naturally.
Now for each line of text in the multi-line TextBox:
Exactly how do you want to use that to filter either certain Cells, or certain Rows, or certain Columns, in your DataGridView ?
What exactly does "filter" mean here: to hide something that does not "match," or ... ?
What have you tried so far ?
I do think if you can write up your problem more clearly, that it would be better, for you, if you posted it in the QA section.
best, Bill
"Everything we call real is made of things that cannot be regarded as real." Niels Bohr
|
|
|
|
|
Thanks everybody for helping! And sorry for late answer.
Bill , as you're saying i have a datagridview full of data.
What I want is show the datagridview rows that match with the lines in the multiline textbox
For example: my datagridview have two columns: Name and Last Name to say something...
In the textbox I type in the first line John and in the second line I type Mary.
I want the datagrid to show me only the rows that have these names.
And if I keep typing in others lines keep doing the firter or search...
I hope I explained better now... Thanks in advance!
|
|
|
|
|
If you will re-post this in QA, with the details you've disclosed: I will respond in greater depth, and I think you'll get many other helpful comments from other people.
best, Bill
"Everything we call real is made of things that cannot be regarded as real." Niels Bohr
|
|
|
|
|
Ok.
Sorry im newbi in the foro, can you plese guide me how to do the post in QA.
Thanks in advance!
|
|
|
|
|
From CP's Main Menu: mouse over "Quick Answers:" select "Ask a Question" from the drop-down menu.
best, Bill
"Everything we call real is made of things that cannot be regarded as real." Niels Bohr
|
|
|
|
|
please let me know if any type of document(.pdf .jpeg etc) stored in sql server (byte or image format) how to retrieve in to front end in Image box in web application
|
|
|
|
|
Try this[^]. It should help.
|
|
|
|
|
Hi to All
I Have a Solution in C# that have 4 projects in it.
I want to Showing Forms of Other projects when I have
its Name(Such as Project2.Frm_Log).
I use this code:
string formTypeName = "frm1";
Type formType = Type.GetType(formTypeName);
Form f = (Form)Activator.CreateInstance(formType);
f.Show();
but the value Of formType will be null.
please help me.
|
|
|
|
|
You don't need reflection to do that. First, lay a reference from the project where you want to use the form, to the project where the form to be used is located. Should be a menu around there somewhere, saying something like "add references".
Then it would be something as simple as this;
using System;
using System.Windows.Forms;
using Project2;
class MainForm: Form
{
public MainForm()
{
}
public ShowTestForm()
{
using (var f = new frm1())
{
if (DialogResult.OK != f.ShowDialog(this))
{
throw new Exception ("Replace the user until someone is brave enough to click OK!");
}
}
}
}
Hope it helps a bit
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
thank you for replying , but the form name is in string format and then your code dosnt work.
using (var f = new frm1())
|
|
|
|
|
Would you care to explain why it needs to be in a string format? If not, a simple strategy-method would solve the problem;
public Form BakeMeSomeNiceForm(string Whut)
{
switch (Whut)
{
case "frm1": return new frm1;
case "frm2": return new frm2;
default: throw new UnknownSwitchValue(Whut);
}
}
Use the method where your string is right now, it'll return the form requested by the string. Might require some casting.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
the solution you have proposed here seems a much better way of doing things, every time i try to think of a reason for needing to just be able to work with a string i come back to what is wrong with just calling a factory method.
|
|
|
|
|
not sure what the requirement is but this code should work for you, not sure it is the best or right way but was the quickest answer i could write
string formName = "ToCreate.Form1";
var asm = Assembly.Load("ToCreate");
Type formType = asm.GetType(formName);
Form f = (Form) Activator.CreateInstance(formType);
f.Show();
the control libary is called "ToCreate", you need to pass the full name including assembly to the asm.GetType method, i also included a reference from the main project to the project containg form1.
|
|
|
|
|
If he referenced the project, it'd already be loaded. Next, this assembly will not be unloaded. Then there's the slower Activator.
I didn't feel like changing that, as I'd use strong-typing to get the initial string;
string formClassName = typeof(frm1).Name;
Depends; if it has to be a plugin, I'd understand. For all other problems, I'd go for the simple solution.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
thanks all for your awnsering.
it works.
this code works good.
string formName = "ToCreate.Form1";
var asm = Assembly.Load("ToCreate");
Type formType = asm.GetType(formName);
Form f = (Form) Activator.CreateInstance(formType);
f.Show();
thanks,thaks specially to Ed Hill _5_
|
|
|
|
|
Dear fiends my question is much long but please help me solve my problem.
i m completely stuck hear.
I m tried to extract images from pdf using itexsharp but when i extract them the images looks like convert to negative form, I think my pdf containing high quality images. I used following code sample for extract images from pdf.
private static List<system.drawing.image> ExtractImages(String PDFSourcePath)
{
List<system.drawing.image> ImgList = new List<system.drawing.image>();
try
{
RAFObj = new iTextSharp.text.pdf.RandomAccessFileOrArray(PDFSourcePath);
PDFReaderObj = new iTextSharp.text.pdf.PdfReader(RAFObj, null);
for (int i = 0; i <= PDFReaderObj.XrefSize - 1; i++)
{
PDFObj = PDFReaderObj.GetPdfObject(i);
if ((PDFObj != null) && PDFObj.IsStream())
{
PDFStremObj = (iTextSharp.text.pdf.PdfStream)PDFObj;
iTextSharp.text.pdf.PdfObject subtype = PDFStremObj.Get(iTextSharp.text.pdf.PdfName.SUBTYPE);
if ((subtype != null) && subtype.ToString() == iTextSharp.text.pdf.PdfName.IMAGE.ToString())
{
byte[] bytes = iTextSharp.text.pdf.PdfReader.GetStreamBytesRaw((iTextSharp.text.pdf.PRStream)PDFStremObj);
if ((bytes != null))
{
try
{
System.IO.MemoryStream MS = new System.IO.MemoryStream(bytes);
MS.Position = 0;
System.Drawing.Image ImgPDF = System.Drawing.Image.FromStream(MS, true, true);
//System.Drawing.Bitmap ImgPDF = (Bitmap)System.Drawing.Image.FromStream(MS, true, false);
ImgList.Add(ImgPDF);
MS.Flush();
}
catch (Exception)
{
}
}
}
}
}
PDFReaderObj.Close();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
return ImgList;
}
public static void WriteImageFile(string sourcePDFpath, string targetpath)
{
try
{
// Get a List of Image
List<system.drawing.image> ListImage = ExtractImages(sourcePDFpath);
for (int i = 0; i < ListImage.Count; i++)
{
try
{
System.Drawing.Imaging.EncoderParameters parms = new System.Drawing.Imaging.EncoderParameters(1);
parms.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Compression, 0);
System.Drawing.Imaging.ImageCodecInfo jpegEncoder = ImageCodecInfo.GetImageEncoders().Single(p => p.CodecName.Contains("JPEG"));
ListImage[i].Save(targetpath + "\\Image" + (i + 1).ToString().PadLeft(3, '0') + ".Jpeg", jpegEncoder, parms);
}
catch (Exception ex)
{
throw ex;
}
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
But this solution is not worked for my purpose. So i found a another program call 'pdfimages' is support to extract images from pdf, this exe extract images from pdf in .ppm format so i passed the command line argument to this exe and make exe to work and after the exe executed i convert ppm files to jpeg from my application.
This work for my task nicely. But i have another problem now. When i converted the image the quality of the image is reduced.
When extracting image from Pdf writer it shows.
Bit Depth : 32
Horizontal Resolution : 296dpi
Vertical Resolution : 296dpi
But my images it shows
Bit Depth : 24
Horizontal Resolution : 96dpi
Vertical Resolution : 96dpi
I need to extract images from pdf with the same quality, can anyone tell me a method for do my task...?
|
|
|
|